djangosnippets.org: Latest snippets tagged with 'fieldlistfilter'https://djangosnippets.org/tags/fieldlistfilter/2012-06-24T00:26:55.286878-05:00Closure for FieldListFilter classes with custom sets of ranges
2012-06-24T00:26:55.286878-05:00ssokolowhttps://djangosnippets.org/snippets/2779/<p>This closure lets you quickly produce date-style range filters in the Django Admin interface without having to create a new class for each one.</p>
<p>It follows Python range semantics, with the lower value using a <code>_gte</code> test and the upper value using an <code>_lt</code> test.</p>
<p>Here's an example of how …</p>
Freely redistributableIsNullFieldListFilter
2012-06-23T23:36:23.138346-05:00ssokolowhttps://djangosnippets.org/snippets/2778/<p>As the title does a pretty good job of condensing, this is a subclass of <code>FieldListFilter</code> for the Django 1.4 Admin system which allows you filter by whether a field is or is not <code>NULL</code>.</p>
<p>For example, if you had an <code>Author</code> model and wanted to filter it by …</p>
Freely redistributable