Monday, July 25, 2016

How do I do a multiple select in the Admin filters ?

Hi everyone,

For the project I'm working on, I got a Dish Model in which, in order to filter different dishes for allergens or other reasons, I got a BooleanField to check if the dish is pork-free, another to check if it's nuts-free and a good other dozen.

As you would expect, displaying all thoses filters side by side would by very unesthetical and unpratical. So I aimed to reduce their number to two: One multiple select filter for "contains this:", and another for "does not contain:".

My researches so far were not very successful : the best I could find is this module , namely Django-adminfilters, that I could not quite get to work, as well as many not-so-helpful SO posts.

Could someone please enlighten me, be it with a way to do it or a workaround ?
Thanks a lot !

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/44ac6507-4072-4677-8dde-dd367145e826%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment