tags:

views:

7

answers:

0

I have:

class MyModelAdmin(admin.ModelAdmin):
    list_display = ('name', 'locked', )

It displays the nice green and red icons for the locked field.

What I want is to show inverted values in locked field.

So i wrote this:

def not_locked(obj):
    return not obj.locked
class MyModelAdmin(admin.ModelAdmin):
    list_display = ('name', not_locked,)

And this works (inverts the values), but it displays ugly True or False instead of the nice green and red icons.

How to make it show the icons again?