Need to trunate text in admin list_display
Have the following in admin model but still shows full text.
from django.template.defaultfilters import truncatewords
def get_description(self, obj):
return truncatewords(obj.description, 10)
get_description.short_description = "description"
class DieTaskAdmin(admin.ModelAdmin):
list_display =['severity','priority', 'subject', 'status','created',get_description.short_description']
admin.site.register(DieTask, DieTaskAdmin)
i.e original text of description field contains more than 255 char. I like to only display the first 10 char plus ...