I want to add a custom model method to the admin filter, however it fails.
Example Foo:
class Foo(models.Model):
number = models.IntegerField()
def big_enough(self):
return self.number > 99
now at the admin panel:
class FooAdmin(admin.ModelAdmin):
list_filter = ('number', 'big_enough')
Fails, I get the error
ImproperlyConfigured at /admin/test/foo/ 'FooAdmin.list_filter[0]' refers to field 'big_enough' that is missing from model 'Foo'.