How to display a boolean property in the django admin

this is the simplest way I found, directly in the ModelAdmin:

class MyModelAdmin(admin.ModelAdmin):
    def is_something(self, instance):
        return instance.something == "something"
    is_something.boolean = True
    is_something.short_description = u"Is something"

    list_display = ['is_something']

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)