Template help for new django.contrib.comments

2 views
Skip to first unread message

macgregor

unread,
Sep 22, 2008, 5:25:15 PM9/22/08
to Django users
I have the new Comments app installed and working and want to modify
django/contrib/comments/templates/comments/posted.html to include a
link to the content object that a comment gets added to.

For example: If someone posts a comment on a blog entry, the comment
gets added and then the user is redirected to /comments/posted?c=X
where X is the comment id. How can I get a URL to the blog entry that
this comment belongs to?

Thanks, Greg.

Delta20

unread,
Sep 22, 2008, 5:37:18 PM9/22/08
to Django users
I have the exact same question. I also tried using
"object.get_content_object.get_absolute_url" but that didn't work
either.

macgregor

unread,
Sep 22, 2008, 5:46:59 PM9/22/08
to Django users
Think I may have just figured it out

comment.content_object.get_absolute_url works for me.
Reply all
Reply to author
Forward
0 new messages