Dear Django users,

Here is a question I can't find an answer for in the docs and from Mr.
Google.  In an admin list display, I have set up a column that
displays records that are related to the current record.  Now I want
to be able to directly open that related record, instead of the record
that the first field links to.  I have set up a callable in the
admin.py, but the HTML I eject there gets escaped, so that I end up
seeing <a href="">etc</a> in the list, instead of the link.  Here is
the relevant piece of admin.py:

class CharAdmin(admin.ModelAdmin):
    [.. some stuff omitted ..]
    list_display = ["character", "unicode", "varchars", "ids"]
    list_filter = ["types"]
    inlines = (CharVarInline,)
    def varchars(self, obj):
          safestr = u"%s"%(",".join(["<a href='./%s'>%s</a>:%s"%(d.id,
d.character, d.unicode) for d in obj.vars.all()]))
          return mark_safe(safestr)
    varchars.short_description = "Variant Characters"
    varchars.is_safe = True

However, I still see the HTML markup escaped in the admin client.  I
also tried to use an {% autoescape off %} block, but to no avail.  Any
help appreciated!

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