#3416: Model API documentation section 'Modifying initial Manager QuerySets'
misleads about Admin behaviour
--------------------------+-------------------------------------------------
Reporter: Alex Dedul | Owner: jacob
Status: new | Component: Documentation
Version: SVN | Resolution:
Keywords: | Stage: Unreviewed
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
--------------------------+-------------------------------------------------
Comment (by Alex Dedul):
I'm not trying to use custom manager directly in the code, but to tell
admin app to use it(to prefilter records in change list). And whatever i
call custom manager in a model 'objects' or 'test_manager' or something
else it has no effect on admin's change list.
One more thing - tried with custom manager to see values of foreign key on
a change form and here it works correctly displaying records from custom
manager and not using default one with all records. So it seems it boils
down to
{{{
django.db.models.AdminOptions.__init__()
}}}
and to this line:
{{{
self.manager = manager or Manager()
}}}
where manager is an attribute(undocumented) you can set on inner Admin
class and Manager() is a default manager with all records.
So as for me its worth mentioning in docs about this hidden 'manager'
attribute and say that model's custom managers is not used in admin's
change lists(if we reference admin app in that 'Modifying initial Manager
QuerySets' section).
--
Ticket URL: <http://code.djangoproject.com/ticket/3416#comment:2>
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
-~----------~----~----~----~------~----~------~--~---