Filter PageChooserPanel queryset
See original GitHub issueIt would be great if you could filter Pages on PageChooserPanel using a queryset.
Something like:
PageChooserPanel('link_page', queryset=EventPage.objects.live().descendant_of(events_index)),
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:24 (14 by maintainers)
Top Results From Across the Web
wagtail - Filter the pages available to link to another page
I've been trying to find a way to filter a the values in a chooser (PageChooserPanel). I'm building a story site where authors...
Read more >Developers - Filter PageChooserPanel queryset - - Bountysource
Filter PageChooserPanel queryset ... It would be great if you could filter Pages on PageChooserPanel using a queryset. Something like: PageChooserPanel('link_page ...
Read more >Filter Reference — django-filter 22.1 documentation
An optional argument that tells the filter how to handle the queryset. It can accept either a callable or the name of a...
Read more >Available panel types — Wagtail 2.9 documentation
PageChooserPanel takes one required argument, the field name. Optionally, specifying a page type (in the form of an "appname.modelname" string) will filter ......
Read more >How To Prevent Duplicates When Using Modelchoicefilter In ...
It would be great if you could filter Pages on PageChooserPanel using a queryset. in Django admin which is Django admin's equivalent of...
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
Not quite the same as specifying the
QuerySet
perPageChooserPanel
, but this issue is one of the top results for filtering thePageChooserPanel
through any means so I thought it would be good to link to this relevant wagtail hook: https://docs.wagtail.io/en/v1.11.1/reference/hooks.html#construct-page-chooser-querysetThat hook might then be used like:
In order to achieve the site-limited query sets mentioned by @cnk.
@brylie Overriding
get_object_list
is indeed the way to go.