views:

113

answers:

1

I need to generate external links in admin interface grid column, but they shows as html code:

<a href="http://www.site.com/"&gt;site&lt;/a&gt;

Admin interface translates my links as html-entities and they doesn't shows as right links. Is it possible to show external links there, not html code?

I think list_display_links doesn't work for this purpose.

Thank you!

+7  A: 

Just go further in http://docs.djangoproject.com/en/dev/ref/contrib/admin/#list-display

def colored_name(self):
    return '<span style="color: #%s;">%s %s</span>' % (self.color_code, self.first_name, self.last_name)
colored_name.allow_tags = True
Andrea Di Persio