#27303: Allow FilterSpecs to return Q-likes -------------------------------+-------------------------------------- Reporter: Yeago | Owner: nobody Type: New feature | Status: new Component: contrib.admin | Version: 1.10 Severity: Normal | Resolution: Keywords: filterspec | Triage Stage: Unreviewed Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------+-------------------------------------- Changes (by Simon Charette):
* cc: Simon Charette (added) Comment: I wonder if we could introduce a new filterspec API that relies on [https://github.com/django/django/search?utf8=%E2%9C%93&q=sticky the ''sticky filter'' behavior] of the ORM for this purpose instead: {{{#!python list_filters = [ ('multi__value', StickyFilter([ 'lookup', ('other', SomeFilterSpect()), ])) ] }}} The `StickyFilter` (or whatever name we find for this object) would delegate filtering and rendering to its underlying filters but make sure to mark the `queryset` object passed to it as having ''sticky'' filters (aliases are reused when a queryset is sticky) before calling each of its filters `queryset(request, sticky_queryset)` methods. -- Ticket URL: <https://code.djangoproject.com/ticket/27303#comment:22> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.36d4ad88923fcd96cf88c5259e42aef3%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.