I have a horizon table (tables.DataTable) with two columns. I would like to add a third that displays an icon, but can't find any way to do this.
# Return the image to be used for thw row item def get_image_url(item): return "<a href=\"/test\"><IMG SRC=\"image.gif\" ALT=\"some text\" WIDTH=32 HEIGHT=32></a>" class StackCatalogueTable(tables.DataTable): # This coloumn should display the icon image = tables.Column(get_image_url, verbose_name=_("")) name = tables.Column("name", verbose_name=_("Name")) short_description = tables.Column("description", verbose_name=_("Description")) class Meta: name = "stackcatalogue" verbose_name = _("Stack Catalogue") row_actions = (LaunchStack,)
In the above, I've tried to embed the tag into the table, but it just displays the html text, as opposed to the image.
When I view the source code, I can see that the '<' tags have been converted/escaped to '<' and '>'
Is there any way to prevent the code from being escaped, or is there a better way to display an Icon?