I have a Django model containing a text box. In the admin GUI, I would like to be able to filter only those entries that contain text in this field. Is it possible?
Code like this will filter the contents of the text box, but displays the filters on "All" and each individual entry in the filter. I would like to filter out "Everything" or "Contains something."
class MyModel(models.Model):
textfield = models.CharField(max_length=100)
class MyModelAdmin(admin.ModelAdmin):
list_display = ('...', 'textfield', '...')
list_filter = ('...', 'textfield', '...')
source
share