Update: now Python 3 compatible
$ pip install django-liststyle==0.2b
INSTALLED_APPS = {
...
'liststyle',
...
'django.contrib.admin',
...
}
class MyModelAdmin(admin.ModelAdmin, ListStyleAdminMixin):
...
def get_row_css(self, obj, index):
if obj.active:
return 'red red%d' % index
return ''
Note: If you have your own change_list_results.html; you'll need to incorporate the changes from the one here. An example of a custom template from the "grappelli" package is included in templates/admin/ dir.