On Sep 22, 2:07 pm, Rodney Topor <[email protected]> wrote:
> Suppose a user posts a comment about a particular object, using
> django.contrib.comments, as described in Practical Django Projects.
> How can one get access to this object in a template such as
> posted.html, so that one can include a link directly back to the
> object?
There's a generic foreign key, called content_object, back to the
object. So {{ comment.content_object.get_absolute_url }} will do the
trick.
See http://docs.djangoproject.com/en/dev/ref/contrib/comments/models/
--
DR.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---