I am storing a image location in my model field named as 'banner'.now in list_display page i want to show that field as a image rather than the name.I have made a function which is the location of image but i cant see the image instead that i am seening string
in my model banner is character varying field
any solution?
def get_banner_image(obj):
img = u''
imgtag = mark_safe(u'<img src="http://www.asdd.com/%s">' % (obj.banner))
img +=imgtag
return mark_safe( '%s' % (img) )
And in my admin.py
list_display =(get_banner_image)