Ok so I have a custom django admin built from a Author Model:
class AuthorAdmin(admin.ModelAdmin):
"""
Author Admin
"""
form = AuthorForm
list_display = ['profile_photo', 'first_name', 'last_name', 'title']
search_fields = ['first_name', 'last_name', 'title', 'credential']
prepopulated_fields = {'slug': ('first_name', 'last_name', 'title')}
def profile_photo(self, obj) :
return '<img src="%s" title="%s" />' % (resize_image(obj.photo, '100x100'), obj.title)
profile_photo.allow_tags = True
But in the django admin listview the column title for the custom column does not have proper capitalization.
Does anyone know how to override the column headers that are built from custom function's names?
I've tried:
def my_function(self, obj) :
"""My Custom Title"""
...
and
def my_function(self, obj) :
class Meta:
verbose_name = _(u"My Custom Title")
question from:
https://stackoverflow.com/questions/9708455/django-admin-listview-customize-column-name 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…