Ticket #15819: non-unique-related-fields-distinct4.diff
File non-unique-related-fields-distinct4.diff, 696 bytes (added by , 13 years ago) |
---|
-
django/contrib/admin/util.py
16 16 """ 17 17 Returns True if 'distinct()' should be used to query the given lookup path. 18 18 """ 19 field_name = lookup_path.split('__', 1)[0] 19 paths=lookup_path.split('__') 20 # If we're more than one join deep, there's a very good chance for dupes 21 if len(paths)>2: 22 return True 23 field_name = paths[0] 20 24 field = opts.get_field_by_name(field_name)[0] 21 25 if ((hasattr(field, 'rel') and 22 26 isinstance(field.rel, models.ManyToManyRel)) or