Putting links into text in Django
Posted
by Dane Larsen
on Stack Overflow
See other posts from Stack Overflow
or by Dane Larsen
Published on 2010-05-10T21:41:10Z
Indexed on
2010/05/10
21:44 UTC
Read the original article
Hit count: 233
I have a notifications app that generates notifications for users. The notification class has to be really general, because notifications are generated by all sorts of different things.
My question is this: How do I insert links into the text of the notifications?
What I tried was this:
note = Notification(..., notification="""%s %s has accepted the task: <a href="/tasks/%d/">%s</a>.""" % (request.user.first_name, request.user.last_name, task.id, task.name), ...)
In retrospect, it's obvious this wouldn't work. How should I go about this? Thanks in advance!
© Stack Overflow or respective owner