Hi all - In the standard admin page for the latest svn release I'm
having problems rendering html correctly in the table.
Some of my text fields contain html markup: <a href=http://
www.google.com>link to google</link> for example.
However, when I render these fields (using the change_list.html admin
template) i get <, > for some of the brackets < & > in the output
html.
If I change the change_list_results.html file so it uses the item|safe
filter I still get the same problem:
<table cellspacing="0">
<thead>
<tr>
{% for header in result_headers %}<th{{ header.class_attrib }}>
{% if header.sortable %}<a href="{{ header.url }}">{% endif %}
{{ header.text|capfirst }}
{% if header.sortable %}</a>{% endif %}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for result in results %}
<tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item|
safe }}{% endfor %}</tr>
{% endfor %}
</tbody>
</table>
Even if I create my own filter I still get this problem:
@register.filter(name='mysafe')
def mysafe(value):
return value
mysafe.is_safe = True
and use this in the change_list_results.html ({{ item|mysafe }} it
does not help.
Can someone help me out as I'm scratching my head with this.
Regards
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---