I'm trying to influence one of the admin interface change list
fields by using the below get_progress() method in list_display,
and using mark_safe().

However, I can't get this to work:

class Job(models.Model):
     progress = models.PositiveSmallIntegerField()

     def get_progress(self):
         snippet = u"<p>Progress is %d</p>" % self.progress
         return mark_safe(snippet)

What happens is that the "<p>" and "</p>" gets translated into
"&lt;p&gt;" and "&lt;/p&gt;" in the output. I thought mark_safe()
would help me to avoid that. Obviously not right.

Is there another way to tell django not to escape the output?

Any ideas appreciated
/Lars


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to