Note about how distinct may not work when ordering by related model fields
could point the reader at this solution
http://archlinux.me/dusty/2010/12/07/django-dont-use-distinct-and-
order_by-across-relations/, using annotate().
--
Ticket URL: <https://code.djangoproject.com/ticket/19842>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
* needs_docs: => 1
* owner: nobody => anonymous
* needs_tests: => 0
* needs_better_patch: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:1>
* owner: anonymous => dfanders
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:2>
* stage: Unreviewed => Accepted
Comment:
I think it's probably true that many cases of people trying to use
`distinct` and `order_by` on related fields together would be solved by
`annotate`. It wouldn't hurt to mention `annotate` in that note.
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:3>
* owner: dfanders => anonymous
Comment:
I also came accross this problem. I will try to put this suggestion in the
Documentation as part of the DjangoCon Euro 2013 sprints.
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:4>
* owner: anonymous => jgeskens
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:5>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:6>
Comment (by jonathanslenders):
This documentation patch looks fine.
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:7>
Comment (by jgeskens):
https://github.com/django/django/pull/1107
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:8>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:9>
* stage: Ready for checkin => Accepted
Comment:
The documentation should be improved with an example, as suggested by
@timgraham
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:10>
Comment (by jgeskens):
Fixed a typo in the patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:11>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:12>
* owner: jgeskens =>
* status: assigned => new
* easy: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:13>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:14>
* status: new => assigned
* cc: avani9330 (added)
* owner: => avani9330
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:15>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:16>
* needs_docs: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:17>
* stage: Ready for checkin => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:18>
Comment (by bithin):
https://github.com/django/django/pull/1869
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:19>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:20>
* owner: avani9330 =>
* status: assigned => new
* version: 1.4 => master
--
Ticket URL: <https://code.djangoproject.com/ticket/19842#comment:21>