djangosnippets.org: Latest snippets tagged with 'list-filter'https://djangosnippets.org/tags/list-filter/2013-12-11T02:53:15.256320-06:00View all log entries in the admin 2
2013-12-11T02:53:15.256320-06:00tgandorhttps://djangosnippets.org/snippets/3009/<p>Based on:
<a href="https://djangosnippets.org/snippets/2484/">View all log entries in the admin</a></p>
<p>Improvements:</p>
<ul>
<li>No crash on <code>object_link</code> when reverse route missing,</li>
<li>Filter by users present in the log AND in database currently</li>
<li>Other filters on users - only superusers / only staff (modify to fit your needs)</li>
</ul>
<p>EDIT:</p>
<p>Incorporated <code>action_description</code> from <a href="https://github.com/yprez/django-logentry-admin">django-logentry-admin</a>. …</p>
Freely redistributableForeign Key list_filter wthout custom FilterSpec
2010-02-04T20:18:00.520074-06:00haileris23https://djangosnippets.org/snippets/1911/<p>This is some (probably) pretty dodgy code that allows for foreign keys in the admin's list_filter without using a custom FilterSpec. It overrides the django.db.models.options.Options get_field class to handle spanned relationships, i.e. list_filter=('house<strong>room</strong>town',) as seen in http://code.djangoproject.com/ticket/3400
</p>
<p>I have only tested this with a double foreign key relationship('house__room'), …</p>
Freely redistributable