On Sep 22, 11:15 pm, Daniel Roseman <[email protected]> wrote:
> On Sep 22, 2:07 pm, RodneyTopor<[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.
> Seehttp://docs.djangoproject.com/en/dev/ref/contrib/comments/models/
>
> DR.
>
Many thanks.  I eventually found this myself.  It's even in Practical
Django
Projects, just several pages beyond where it first seemed to be
needed.

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

Reply via email to