--- a/qrurls/admin.py Sat Aug 31 19:11:37 2013 +0300
+++ b/qrurls/admin.py Sat Aug 31 19:21:41 2013 +0300
@@ -228,6 +228,11 @@
)
class URLImageAdmin (admin.ModelAdmin) :
+ def show_image(self, obj):
+ return """<img src="{url}" style="max-width: 480px"/>""".format(url=obj.get_absolute_url())
+ show_image.short_description = "Image"
+ show_image.allow_tags = True
+
list_display = (
'title',
'uploaded',
@@ -236,9 +241,11 @@
fields = (
'image',
'title',
+ 'show_image',
)
readonly_fields = (
'uploaded',
+ 'show_image',
)
inlines = (URLItemInline, )