修改admin代码
list_display = ("content","preview")
def preview(self,obj):
return '<img src="/static/%s" height="64" width="64" />' %(obj.photo)
preview.allow_tags = True
preview.short_description = "picture"
这就ok了
修改admin代码
list_display = ("content","preview")
def preview(self,obj):
return '<img src="/static/%s" height="64" width="64" />' %(obj.photo)
preview.allow_tags = True
preview.short_description = "picture"
这就ok了
转载于:https://my.oschina.net/u/1032854/blog/204900