# HG changeset patch # User Tero Marttila # Date 1377966101 -10800 # Node ID b968f33d780c486598267448cacb9bd75173f84b # Parent 9d1184cdbd16481cc024d2164647dc652d88865c show uploaded URLImage in admin diff -r 9d1184cdbd16 -r b968f33d780c qrurls/admin.py --- 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 """""".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, )