#7510: ModelAdmin should be able to use a non-default manager
---------------------------------------------+------------------------------
          Reporter:  tom                     |         Owner:  nobody  
            Status:  new                     |     Milestone:  post-1.0
         Component:  django.contrib.admin    |       Version:  SVN     
        Resolution:                          |      Keywords:          
             Stage:  Design decision needed  |     Has_patch:  1       
        Needs_docs:  0                       |   Needs_tests:  0       
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Changes (by scel):

 * cc: [EMAIL PROTECTED] (added)
  * summary:  Patch to have change_view and delete_view methods of
              ModelAdmin use queryset the queryset method =>
              ModelAdmin should be able to use a non-default
              manager

Comment:

 I changed the summary as I think the ability to use a non-default manager
 is more important and implies the original request to be honored.

 I also want to point out that the documentation on this topic is incorrect
 (at least as I read it):
 {{{
 Django interprets this first
 ``Manager`` defined in a class as the "default" ``Manager``, and
 several parts of Django (though not the admin application) will use
 that ``Manager`` exclusively for that model.
 }}}
 from docs/topics/db/managers.txt:170-173 or
 [http://docs.djangoproject.com/en/dev/topics/db/managers/#modifying-
 initial-manager-querysets online docs]

 As I interpret this, the admin is supposed to always use a "bare"
 ''Manager()'', not the default manager, as it is currently doing.

 Plus, this makes it impossible to use a custom manager in related lookups,
 but not the admin (''use_for_related_fields'' can only be used in the
 default manager, I don't really know why there is no
 ''Model.Meta.related_manager'' option).

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