Additional Search/Filtering based on a Model's fields in horizontal_filter

18 views
Skip to first unread message

Keehun Nam

unread,
Jan 20, 2016, 10:35:48 PM1/20/16
to Django users
Hi Django Users,

Is there a preexisting solution where I can have an admin widget like horizontal_filter except it has the ability to search by the model's fields (not just the string representation in a list?

Say I have a PERSON model with fields: Name, Country, and Vehicle Type. Right now, what I'm doing is overriding __str__ on PERSON to show "Full Name (Country, Vehicle Type)" so I can search by typing into the search bar in the horizontal_filter whatever I'm looking for and get it searched that way.

However, this is not very scalable when you have more than a few fields. Any packages?

I have a few text fields (with choices) that I'd like to filter by.

Thank you,
Keehun Nam

Dheerendra Rathor

unread,
Jan 20, 2016, 10:53:16 PM1/20/16
to Django users
You can add your fields in search_fields in ModelAdmin to make them searchable. 

--
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...@googlegroups.com.
To post to this group, send email to django...@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/cec2a5a2-be55-4b70-b398-d4cf38bb9f93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages