Django: Ticket #11848: Hook to be able to customize changelist_viewhttps://code.djangoproject.com/ticket/11848
<p>
Currently, the changelist_view uses self.queryset to display the list of objects instances. So, to customize what changelist will use, you need to customise self.queryset. The bad point is that change_view also uses self.queryset, and maybe you don't wan't do affect it.
</p>
<p>
For example: I have a list of Page objects, that could have subpages. The subpages are Pages too, but are not listed in changelist. But you should be able to edit subpages (since they are Page objects). I've attached an image of my admin with this use case.
If I customize self.queryset to hide subpages (in changelist view), I can't access subpages form (change view) anymore.
</p>
<p>
I've attached a patch fix this. Just creating a self.queryset_changelist hook. And changing ChangeList to use it. Now I can customize what changelist will show me, without affecting what I can edit.
</p>
en-usDjangohttps://www.djangoproject.com/s/img/site/hdr_logo.gifhttps://code.djangoproject.com/ticket/11848
Trac 1.0.4igorsTue, 08 Sep 2009 00:41:48 GMTattachment sethttps://code.djangoproject.com/ticket/11848
https://code.djangoproject.com/ticket/11848
<ul>
<li><strong>attachment</strong>
set to <em>Picture 2.png</em>
</li>
</ul>
TicketigorsTue, 08 Sep 2009 00:42:15 GMTattachment sethttps://code.djangoproject.com/ticket/11848
https://code.djangoproject.com/ticket/11848
<ul>
<li><strong>attachment</strong>
set to <em>queryset_changelist.patch</em>
</li>
</ul>
TicketkmtraceyTue, 08 Sep 2009 00:45:44 GMTstatus changed; needs_docs, resolution, needs_tests, needs_better_patch sethttps://code.djangoproject.com/ticket/11848#comment:1
https://code.djangoproject.com/ticket/11848#comment:1
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>needs_docs</strong>
unset
</li>
<li><strong>resolution</strong>
set to <em>duplicate</em>
</li>
<li><strong>needs_tests</strong>
unset
</li>
<li><strong>needs_better_patch</strong>
unset
</li>
</ul>
<p>
<a class="new ticket" href="https://code.djangoproject.com/ticket/10761" title="New feature: ModelAdmin.queryset() is missing a mechanism for specifying different ... (new)">#10761</a> is already open requesting this.
</p>
Ticket