wagtail-multiple-chooser-panel


Namewagtail-multiple-chooser-panel JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryAn InlinePanel variant allowing multiple items to be quickly selected
upload_time2022-12-05 17:27:05
maintainer
docs_urlNone
authorMatt Westcott
requires_python
licenseBSD
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Wagtail Multiple Chooser Panel

An InlinePanel variant allowing multiple items to be quickly selected

[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![PyPI version](https://badge.fury.io/py/wagtail-multiple-chooser-panel.svg)](https://badge.fury.io/py/wagtail-multiple-chooser-panel)
[![Multiple Chooser Panel CI](https://github.com/wagtail/wagtail-multiple-chooser-panel/actions/workflows/test.yml/badge.svg)](https://github.com/wagtail/wagtail-multiple-chooser-panel/actions/workflows/test.yml)

## About

This package provides an improved user interface for the common setup of a chooser widget inside an InlinePanel - for example, an image gallery consisting of a list of images chosen from the Wagtail image library. Normally, this would require adding a new child form for each item, opening the chooser modal and selecting an individual item each time. With the `MultipleChooserPanel` provided by this package, the "Add item" button now opens the chooser modal immediately, with the ability to select multiple items - all selected items are then added as child forms.

![Example of MultipleChooserPanel in use on a blog page on the bakery demo site: the user clicks "Add author(s)", opening up a person chooser with checkboxes against each name. The user ticks the boxes for Muddy Waters and Olivia Ava, then clicks "Confirm selection" - this results in Muddy Waters and Olivia Ava being added as authors for the blog page.](docs/multiple-chooser-panel.gif)

In this version, only choosers implemented via [wagtail-generic-chooser](https://github.com/wagtail/wagtail-generic-chooser) are supported; it is planned that this functionality will be incorporated into a future Wagtail release, with support for all of Wagtail's built-in choosers as well as custom choosers created through [ChooserViewSet](https://docs.wagtail.org/en/stable/extending/generic_views.html#chooserviewset).

## Links

- [Documentation](https://github.com/wagtail/wagtail-multiple-chooser-panel/blob/main/README.md)
- [Changelog](https://github.com/wagtail/wagtail-multiple-chooser-panel/blob/main/CHANGELOG.md)
- [Contributing](https://github.com/wagtail/wagtail-multiple-chooser-panel/blob/main/CHANGELOG.md)
- [Discussions](https://github.com/wagtail/wagtail-multiple-chooser-panel/discussions)
- [Security](https://github.com/wagtail/wagtail-multiple-chooser-panel/security)

## Supported versions

- Python 3.7 - 3.11
- Django 3.2 - 4.1
- Wagtail 4.1

## Installation

- Ensure you have [wagtail-generic-chooser](https://github.com/wagtail/wagtail-generic-chooser) version 0.5 or above installed
- `pip install wagtail-multiple-chooser-panel`
- Add `"wagtail_multiple_chooser_panel"` to INSTALLED_APPS

## Usage

Beginning from an `InlinePanel` setup where the child model has a field with a chooser widget defined through `wagtail-generic-chooser`, such as:

```python
class BlogPersonRelationship(Orderable, models.Model):
    page = ParentalKey(
        "BlogPage", related_name="blog_person_relationship", on_delete=models.CASCADE
    )
    person = models.ForeignKey(
        "base.Person", related_name="person_blog_relationship", on_delete=models.CASCADE
    )
    panels = [FieldPanel("person", widget=PersonChooser)]


class BlogPage(Page):
    content_panels = Page.content_panels + [
        # ...
        InlinePanel(
            "blog_person_relationship",
            label="Author(s)", min_num=1
        ),
    ]
```

Import `MultipleChooserPanel` from `wagtail_multiple_chooser_panel.panels`, replace `InlinePanel` with `MultipleChooserPanel`, and add a new `chooser_field_name` parameter that specifies the field of the child model that has the chooser widget:

```python
from wagtail_multiple_chooser_panel.panels import MultipleChooserPanel

# BlogPersonRelationship definition remains unchanged

class BlogPage(Page):
    content_panels = Page.content_panels + [
        # ...
        MultipleChooserPanel(
            "blog_person_relationship",
            chooser_field_name="person",
            label="Author(s)", min_num=1
        ),
    ]
```


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "wagtail-multiple-chooser-panel",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Matt Westcott",
    "author_email": "matthew@torchbox.com",
    "download_url": "https://files.pythonhosted.org/packages/d5/97/5dbf202f0d8e4b1a208f59dcf3a326ec60dc9a71b208b427391473c8586e/wagtail-multiple-chooser-panel-0.1.0.tar.gz",
    "platform": null,
    "description": "# Wagtail Multiple Chooser Panel\n\nAn InlinePanel variant allowing multiple items to be quickly selected\n\n[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n[![PyPI version](https://badge.fury.io/py/wagtail-multiple-chooser-panel.svg)](https://badge.fury.io/py/wagtail-multiple-chooser-panel)\n[![Multiple Chooser Panel CI](https://github.com/wagtail/wagtail-multiple-chooser-panel/actions/workflows/test.yml/badge.svg)](https://github.com/wagtail/wagtail-multiple-chooser-panel/actions/workflows/test.yml)\n\n## About\n\nThis package provides an improved user interface for the common setup of a chooser widget inside an InlinePanel - for example, an image gallery consisting of a list of images chosen from the Wagtail image library. Normally, this would require adding a new child form for each item, opening the chooser modal and selecting an individual item each time. With the `MultipleChooserPanel` provided by this package, the \"Add item\" button now opens the chooser modal immediately, with the ability to select multiple items - all selected items are then added as child forms.\n\n![Example of MultipleChooserPanel in use on a blog page on the bakery demo site: the user clicks \"Add author(s)\", opening up a person chooser with checkboxes against each name. The user ticks the boxes for Muddy Waters and Olivia Ava, then clicks \"Confirm selection\" - this results in Muddy Waters and Olivia Ava being added as authors for the blog page.](docs/multiple-chooser-panel.gif)\n\nIn this version, only choosers implemented via [wagtail-generic-chooser](https://github.com/wagtail/wagtail-generic-chooser) are supported; it is planned that this functionality will be incorporated into a future Wagtail release, with support for all of Wagtail's built-in choosers as well as custom choosers created through [ChooserViewSet](https://docs.wagtail.org/en/stable/extending/generic_views.html#chooserviewset).\n\n## Links\n\n- [Documentation](https://github.com/wagtail/wagtail-multiple-chooser-panel/blob/main/README.md)\n- [Changelog](https://github.com/wagtail/wagtail-multiple-chooser-panel/blob/main/CHANGELOG.md)\n- [Contributing](https://github.com/wagtail/wagtail-multiple-chooser-panel/blob/main/CHANGELOG.md)\n- [Discussions](https://github.com/wagtail/wagtail-multiple-chooser-panel/discussions)\n- [Security](https://github.com/wagtail/wagtail-multiple-chooser-panel/security)\n\n## Supported versions\n\n- Python 3.7 - 3.11\n- Django 3.2 - 4.1\n- Wagtail 4.1\n\n## Installation\n\n- Ensure you have [wagtail-generic-chooser](https://github.com/wagtail/wagtail-generic-chooser) version 0.5 or above installed\n- `pip install wagtail-multiple-chooser-panel`\n- Add `\"wagtail_multiple_chooser_panel\"` to INSTALLED_APPS\n\n## Usage\n\nBeginning from an `InlinePanel` setup where the child model has a field with a chooser widget defined through `wagtail-generic-chooser`, such as:\n\n```python\nclass BlogPersonRelationship(Orderable, models.Model):\n    page = ParentalKey(\n        \"BlogPage\", related_name=\"blog_person_relationship\", on_delete=models.CASCADE\n    )\n    person = models.ForeignKey(\n        \"base.Person\", related_name=\"person_blog_relationship\", on_delete=models.CASCADE\n    )\n    panels = [FieldPanel(\"person\", widget=PersonChooser)]\n\n\nclass BlogPage(Page):\n    content_panels = Page.content_panels + [\n        # ...\n        InlinePanel(\n            \"blog_person_relationship\",\n            label=\"Author(s)\", min_num=1\n        ),\n    ]\n```\n\nImport `MultipleChooserPanel` from `wagtail_multiple_chooser_panel.panels`, replace `InlinePanel` with `MultipleChooserPanel`, and add a new `chooser_field_name` parameter that specifies the field of the child model that has the chooser widget:\n\n```python\nfrom wagtail_multiple_chooser_panel.panels import MultipleChooserPanel\n\n# BlogPersonRelationship definition remains unchanged\n\nclass BlogPage(Page):\n    content_panels = Page.content_panels + [\n        # ...\n        MultipleChooserPanel(\n            \"blog_person_relationship\",\n            chooser_field_name=\"person\",\n            label=\"Author(s)\", min_num=1\n        ),\n    ]\n```\n\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "An InlinePanel variant allowing multiple items to be quickly selected",
    "version": "0.1.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "57cea4ec166828450b8ce26430d0d5b1",
                "sha256": "0a145a9d6300bd80d872ccfe557defb86ec1b3e0f6695cdc480643ed4bc07dd6"
            },
            "downloads": -1,
            "filename": "wagtail_multiple_chooser_panel-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "57cea4ec166828450b8ce26430d0d5b1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 18499,
            "upload_time": "2022-12-05T17:27:03",
            "upload_time_iso_8601": "2022-12-05T17:27:03.546357Z",
            "url": "https://files.pythonhosted.org/packages/47/6b/7353d58ff840c6744e5cff32780a59471d6435dc0e0fd7c6f2211c8a9f94/wagtail_multiple_chooser_panel-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "abf1ca70c742eeef83a84ad41d929e38",
                "sha256": "07212f02ad43f1d609b5d6257b1743ec805a62e0dc9336221ebf23dbccc7689d"
            },
            "downloads": -1,
            "filename": "wagtail-multiple-chooser-panel-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "abf1ca70c742eeef83a84ad41d929e38",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16672,
            "upload_time": "2022-12-05T17:27:05",
            "upload_time_iso_8601": "2022-12-05T17:27:05.409239Z",
            "url": "https://files.pythonhosted.org/packages/d5/97/5dbf202f0d8e4b1a208f59dcf3a326ec60dc9a71b208b427391473c8586e/wagtail-multiple-chooser-panel-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-05 17:27:05",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "wagtail-multiple-chooser-panel"
}
        
Elapsed time: 0.01897s