#7309: NFA: Don't override order_by if no default ordering is specified
---------------------------------------------+------------------------------
          Reporter:  [EMAIL PROTECTED]  |         Owner:  nobody              
            Status:  new                     |     Milestone:                   
   
         Component:  Admin interface         |       Version:  newforms-admin   
   
        Resolution:                          |      Keywords:  order_by 
nfa-someday
             Stage:  Unreviewed              |     Has_patch:  0                
   
        Needs_docs:  0                       |   Needs_tests:  0                
   
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Changes (by Horst Gutmann <[EMAIL PROTECTED]>):

 * cc: [EMAIL PROTECTED] (added)

Comment:

 Is this even valid anymore? From what I can see in the ModelAdmin class,
 ordering is now handled using the ``ordering`` class-element, which can be
 any list/tuple (I think this happened somewhere around #7484):

 {{
     def queryset(self, request):
         """
         Returns a QuerySet of all model instances that can be edited by
 the
         admin site. This is used by changelist_view.
         """
         qs = self.model._default_manager.get_query_set()
         # TODO: this should be handled by some parameter to the
 ChangeList.
         ordering = self.ordering or () # otherwise we might try to *None,
 which is bad ;)
         if ordering:
             qs = qs.order_by(*ordering)
         return qs
 }}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7309#comment:3>
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