Snippet List
A simple django-admin filter to replace standar RelatedFilterSpec with one with the "All"/"Null"/"Not null" options.
It applies to all relational fields (ForeignKey, ManyToManyField).
You can put the code in the `__init__.py` or wherever you want.
The `_register_front` idea is copied on [this snippet](http://djangosnippets.org/snippets/1963/)
- filter
- admin
- null
- filterspec
- ManyToManyField
- ForeignKey
- not-null
A simple django-admin filter to allow a boolean-like filter for IS NULL/IS NOT NULL.
By default it applies to CharField, IntegerField, and FileField, but you can change this by editing NullFilterSpec.fields.
- filter
- admin
- null
- filterspec
This custom model field is a variant of NullBooleanField, that stores only True and None (NULL) values. False is stored as NULL.
It's usefull for special purposes like unique/unique_together.
One small problem is here, that False is not lookuped as None.
This snippets is a response to [1830](http://www.djangosnippets.org/snippets/1830/)
- null
- field
- custom-field
- none
This patch adds a new admin Filter, for Filtering nullable fields. It adds 3 possible choices: 'All' (no filter), 'Null' (it applies field__isnull=True filter), and 'With Value' (it filters null values).
This patch is interesting when you have a Integer or String fields and you want to filter wether a value is set or not. In other case, it would show too many filtering options.
Remember this is a patch and you must modify a django file in `django/contrib/admin/filterspecs.py`
Sometimes you have to serve null files. This quick hacky generic view lets you do that.
The best example of that is robots.txt, I want my robots.txt to always be empty, at least for now.
The other example would be favicon.ico, but that's more often used to actually fill a purpose.
5 snippets posted so far.