Read up on the concept of "safe" markup: http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#filters-and-auto-escaping
regards Steve On 9/18/2010 6:16 PM, Bobby Roberts wrote: > only thing that does is return this: > > <img src="/static/sitename/images/partners/thumbs/logo_6.jpg" > width="65"/> > > > > I need the image to show rather than just the html for the image. > > any ideas. > > > > On Sep 18, 6:07 pm, Wai Yi Leung <tweak...@gmail.com> wrote: >> Try: >> >> >> >>> class PartnerAdmin(admin.ModelAdmin): >>> list_display = ('xx','AdminTag',) >>> search_fields = ['AdminTag','Title','Description'] >> >>> def xx(self, instance): >>> return '<img src="/static/sitename/%s" width="65"/>' % >>> (instance.Thumbnail) >>> xx.allow_tags=True >> >> Since the admin function is for each row ( instance )... >> >> Op 18 sep 2010, om 22:52 heeft Bobby Roberts het volgende geschreven: >> >>> in my model i have an image field as such: >> >>> Thumbnail= models.ImageField(upload_to="images/partners/ >>> thumbs/", blank=False) >> >>> I want the thumbnail to show in my admin list. My admin class looks >>> like this below: >> >>> class PartnerAdmin(admin.ModelAdmin): >>> list_display = ('xx','AdminTag',) >>> search_fields = ['AdminTag','Title','Description'] >> >>> def xx(self): >>> return '<img src="/static/sitename/%s" width="65"/>' % >>> (self.Thumbnail) >>> xx.allow_tags=True >> >>> The result: >> >>> Caught TypeError while rendering: xx() takes exactly 1 argument (2 >>> given) >> >>> What am i doing wrong here? >> >>> -- >>> 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 >>> athttp://groups.google.com/group/django-users?hl=en. > -- DjangoCon US 2010 September 7-9 http://djangocon.us/ -- 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.