I have a Django model containing a text field. In the admin GUI, I'd like to be able to filter just those records containing text in this field. Is it possible?
Code something like this will filter on the contents of textfield, but shows filters on 'All' and each distinct entry in the filter. I'd like to filter 'All' or 'Contains something'.
class MyModel(models.Model):
# ...
textfield = models.CharField(max_length=100)
# ...
class MyModelAdmin(admin.ModelAdmin):
list_display = ('...', 'textfield', '...')
list_filter = ('...', 'textfield', '...')