I'm running into trouble using the admin interface's search feature,
probably due to the default way that tables are being joined. I have
an Actor and a Group, and a many-to-many relationship between them.
(So Actors can be in multiple Groups, and Groups can have multiple
Actors). For the Group object, I'd like the admin interface to search
by the Group's name or by the lastname of an Actor, so I specify these
in the admin class's search_fields. This works ok when I enter the
lastname of an Actor in the search line. But, if I use a Group's name
in the search line, I see a number of repeated results equal to the
number of Actors in the group. (This also gets zero results if the
Group has no Actors, even if the Group name matches the search line.)

Any tips for making the admin interface search pull up only distinct
Groups and not care if a Group has no Actors if the Group name matches
the search? Or should I be trying some other approach altogether?

This seems to be the same thing as described in this previous question
(at the end of the discussion), but I didn't see a solution there.
http://groups.google.com/group/django-users/browse_thread/thread/b0866749612aaeae/135d13ce40c33aa7?lnk=gst&q=admin+search&rnum=2#135d13ce40c33aa7


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to