#18165: Ordering by related field creates duplicates in resultant querysets -------------------------------------+------------------------------------- Reporter: dokterbob | Owner: nobody Type: Bug | Status: reopened Component: Database layer | Version: 1.4 (models, ORM) | Resolution: Severity: Normal | Triage Stage: Keywords: ordering, | Unreviewed duplicates, related | Needs documentation: 0 Has patch: 0 | Patch needs improvement: 0 Needs tests: 0 | UI/UX: 0 Easy pickings: 0 | -------------------------------------+------------------------------------- Changes (by dokterbob):
* status: closed => reopened * resolution: wontfix => Comment: @akaariai I agree on the difficulty of the issue. In my current situation the `ordering` attribute is indeed being used on the front-end together with filtering. However, in the Admin we have multiple records for the same object popping up - confusing me as a developer, let alone the user. In any case it would make sense to: 1. Document the current behaviour and complications (I would gladly offer my help for that - any help to get me started is appreciated though). 2. Get a reference to the apparently existing duplicate of this one as I was not able to find the original issue after (what I would consider) a through search. 3. Somehow, allow at least the Admin to automatically detect the situation and do a `.distinct()` after filtering, assuring only one record per object and thus a consistent user experience. Simply adding `.distinct()` to the Admin's `queryset` method might not do as it would degrade exactly the kind of filtering required in the current situation. The bottomline in all this: make sure that, at least, we won't confuse the user/developer. Please let me know how you stand in this so I could consider opening relevant related ticket('s) and, in as far as possible 'solve' the issue. -- Ticket URL: <https://code.djangoproject.com/ticket/18165#comment:2> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.