Generic chooser views
See original GitHub issueIntroduce a wagtail.admin.views.generic.chooser
module to serve as a common base implementation for chooser modals. This can be loosely based on wagtail-generic-chooser but should incorporate improvements as outlined in https://github.com/wagtail/wagtail-generic-chooser/issues/44: in particular, using the table UI component for listing views, and using ‘partial’ HTML fragments for the browser results view and ‘create’ form submission so that we aren’t re-rendering the whole modal.
Acceptance criteria:
- A documented base set of views exists in
wagtail.admin.views.generic.chooser
(#8662) - A documented viewset exists in
wagtail.admin.viewsets.chooser
(#8662) - A base chooser widget implementation is provided and documented (#8662)
- A base StreamField chooser block is provided and documented (#8820)
- The page chooser mechanism inherits from this base implementation
- The image chooser mechanism inherits from this base implementation (#8778, #8804)
- The snippet chooser mechanism inherits from this base implementation (#8711, #8717)
- The document chooser mechanism inherits from this base implementation (#8776, #8777)
- A basic chooser for an arbitrary model can be implemented with minimal new code - simply extending the base viewset/widget class and specifying the model as an attribute (#8662)
- New instances can be created through the chooser view (#8726)
- The listing view uses the
wagtail.admin.ui.tables
component (#8662) - Listings are searchable (where the model provides this) (#8669)
- Listings are filterable via
django-filters
filters - Data sources other than models (e.g. django-rest-framework API endpoints) can be used (#8855)
- Where custom logic is common to chooser modals and widgets (e.g. converting an object ID to a dict representation that can be used for widget rendering), code is shared between them
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
wagtail-generic-chooser - GitHub
Chooser views can be used independently of chooser widgets; they are used by rich text editors, for example. Chooser views (model-based). The generic_chooser....
Read more >Generic views - Wagtail's documentation
Wagtail provides a number of generic views for handling common tasks such as creating / editing model instances, and chooser modals.
Read more >wagtail-generic-chooser - PyPI
A toolkit for custom chooser popups in Wagtail. ... wagtail-generic-chooser 0.5. pip install wagtail-generic-chooser. Copy PIP instructions.
Read more >wagtail-generic-chooser widget (NoReverseMatch)
I have an event model referencing an event category model. Both the event category model and the event model are set up as...
Read more >wagtail-generic-chooser - Django Packages
Projects listed on Djangopackages are third-party packages. They are not vetted nor endorsed by the Django Software Foundation. Use them at your own...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lb- Yep, the plan is to deprecate wagtail-generic-chooser - so yes, reviewing those open issues is a good plan. From a quick scan through the list, there’s a mix of things I hope to address in the rewrite (better filtering via django-filters, cleaner API for DRF data sources) and more general wishlist items that are probably a better fit for the Wagtail project anyhow (multiple selection, generalised link choosing).