On Saturday 06 March 2010 06:07:30 dogfuel wrote:
> most of you probably know this will not give the desired result - it
> shows the correct test, but not as a hyperlink.
Moving the method to ModelAdmin and setting `allow_tags` True on it should
solve this problem:
class Destination_admin(admin.ModelAdmin):
list_display = ('name', 'location_nrd', 'link_to_other_site')
def link_to_other_site(self, obj):
return u"<a href='http://www.anothersite.com?location_nbr=%s'
target='_blank'>link</a>" % (obj.location_nbr)
link_to_other_site.allow_tags = True
--
Saygılarımla,
Atamert Ölçgen
-+-
--+
+++
www.muhuk.com
[email protected]
--
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.