I feel like I'm missing something obvious.  Another set of eyes would
be greatly appreciated.

I'm trying to add an image to the change_list form in the admin.
Doesn't seem to work.

Here's a snippet I found that gets me most of the way there:

---- (from models.py) --------

        def image_img(self):
                if self.image:
                        return u'<a href="%s"><img src="%s"></a>' % 
self.image.url_125x125
                else:
                        return '(test)'
        image_img.short_description = 'Image'
        image_img.allow_tags = True


--- (from admin.py) --------

class LibraryAdmin(admin.ModelAdmin):
        list_display = ['image_img', 'image', 'name', 'pub_date']
        form = LibraryForm
        position_field = 'position'
        order_with_respect_to = 'category'

Here is my full models.py:
http://dpaste.com/156429/


TIA.





-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to