Re: Display image in django admin

2008-06-19 Thread Brian Rosner


On Jun 19, 2008, at 11:34 AM, Leon Yeh | New Avenue.net wrote:
>
>   def thumbnail(self):
>   return "" % (self.photo)

After the function add thumbnail.allow_tags = True.

Brian Rosner
http://oebfare.com




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



Display image in django admin

2008-06-19 Thread Leon Yeh | New Avenue.net

Hi All,

I have a small django admin site that I need to display image into the 
object list.

The photo currently contained the path to image. When got to the page of 
django admin escape the html output.

How can I make it so I can output raw html to the django admin ?

class News(models.Model):
title = models.CharField(max_length=100)
content = models.TextField(blank=True,)
link = models.CharField(max_length=300)
photo = models.CharField(max_length=300,  blank=True,)

def thumbnail(self):
return "" % (self.photo)

class Admin:
list_display = ('title','content', 'thumbnail')




Thanks,

Leon Yeh
New Avenue Systems Inc.

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