#6422: Support for 'DISTINCT ON' queries with QuerySet.distinct()
-------------------------------------+-------------------------------------
     Reporter:  Manfred Wassmann     |                    Owner:  jgelens
  <manolo@…>                         |                   Status:  assigned
         Type:  New feature          |                  Version:  SVN
    Component:  Database layer       |               Resolution:
  (models, ORM)                      |             Triage Stage:  Accepted
     Severity:  Normal               |      Needs documentation:  0
     Keywords:  dceu2011             |  Patch needs improvement:  1
    Has patch:  1                    |                    UI/UX:  0
  Needs tests:  0                    |
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by ramiro):

 * needs_better_patch:  0 => 1
 * stage:  Ready for checkin => Accepted


Comment:

 I've update the patch with:

 * The new tests failed for me because on my environment the
 `Tag.objects.order_by('parent__pk').distinct('parent')` call choose
   `['<Tag: t2>', '<Tag: t4>', '<Tag: t1>']` instead of `['<Tag: t3>',
 '<Tag: t45', '<Tag: t1>']`. Had to use `order_by('parent__pk', 'pk')`
 instead.
 * Fleshed out a bit documentation changes:
   * I'd like the note about the need to use an `order_by()` call to be
 more clear. -- I'm clearing RFC because of this.
   * Added some examples of usage based on my interpretation of the new
 functionality.
 * Moved the addition to the AUTHORS file to the right spot
 (lexicographical ordering by last name)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/6422#comment:55>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to