#6422: Support for 'DISTINCT ON' queries with QuerySet.distinct()
---------------------------------------------------------------+------------
   Reporter:  Manfred Wassmann <[EMAIL PROTECTED]>  |                Owner:  
nobody          
     Status:  new                                              |            
Component:  Database wrapper
    Version:  SVN                                              |           
Resolution:                  
   Keywords:                                                   |                
Stage:  Accepted        
  Has_patch:  1                                                |           
Needs_docs:  1               
Needs_tests:  1                                                |   
Needs_better_patch:  1               
---------------------------------------------------------------+------------
Changes (by mtredinnick):

  * needs_better_patch:  0 => 1
  * stage:  Unreviewed => Accepted
  * needs_tests:  0 => 1
  * needs_docs:  0 => 1

Comment:

 Patches against trunk's query.py aren't particularly useful at the moment,
 since that code has been more or less entirely rewritten in the queryset-
 refactor branch. So, if you feel enthusiastic, you could try to update
 this to work with that branch, otherwise it will need to be rewritten
 after the branch is merged into trunk.

 As to the feature itself, the "on_fields" parameter doesn't really fit
 with the rest of the API. Call the parameter "fields" for consistency. In
 fact, given that distinct() takes no parameters currently, it probably
 makes the most sense just to pass it field names: so it will take
 {{{*args}}}. That's consistent with values(), valuelist() and
 select_related().

 I notice the patch doesn't contain any tests, which will be necessary,
 since we need to be able to verify it's correct. Make sure you test any
 interaction with the {{{.count()}}} method on querysets, since that
 required some special handling with normal {{{.distinct()}}} calls.
 Documentation needed as well.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/6422#comment:4>
Django Code <http://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