> Thanks for the quick replay. > The problem is the clip duplication, when relaying on clip_set.count() > and also in the admin site when you see raw duplication after > filtering , it is not very reasonable :) >
Ah, I didn't realise it was in the admin. It'll still be the same underlying problem - the intermediate JOIN table producing too many rows. If you want to 'fix' that, I suspect you'll need to write a custom manager for your Clip model, give it a get_query_set() method that calls the superclass method with .distinct() on the end. > 1. in order to change this behavior in the admin site I need to > manipulate main.py and add distinct() somewhere? Read up on custom managers and the default manager. > 2. I read everywhere that distinct() works really slow and you better > avoid using it. > > what do you say? Things are not 'slow' or 'fast' in isolation. They are either 'too slow', or 'fast enough'. Try it, it may be fast enough for you. If it's not, you'll need to find a faster solution. In particular, if the resultant filtered set is relatively small, then I doubt you'll notice the difference. Cheers, Dan -- Dan Fairs | dan.fa...@gmail.com | www.fezconsulting.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.