Best way to create an advanced search bar for the admin app.

12 views
Skip to first unread message

Nicolas Emiliani

unread,
Nov 20, 2012, 5:08:07 PM11/20/12
to django...@googlegroups.com
Hi people.

I have this huge class Foo that has a lot of attributes , not only that but it has
an m2m relation with a through table that specifies values for each relation,
and I want to be able to search using those values.  
For example :

class Foo 
     ...
class Attr 
     ...

and the

class Has:
    foo
    attr
    value

So basically Foo Has a given Attr with value X. The idea is having on top of the search 
bar at the list form a box that lets you choose (using check boxes) the attributes and values
for each checked attribute (using text boxes).

My idea was redefining change_list.html to present that and somehow, I do not know how yet,
override the search method at the admin site.

Does it sound good? 
Has anyone done this?
Is there another approach?

Any comments will be highly appreciated.

Thanks!
 
--
Nicolas Emiliani

Lo unico instantaneo en la vida es el cafe, y es bien feo.
Reply all
Reply to author
Forward
0 new messages