That worked. I just updated my entries model to include comments =
generic.GenericRelation(FreeThreadedComment)
Thanks.
-Brian
On Jul 18, 12:30 pm, "Scott Moonen" <[EMAIL PROTECTED]> wrote:
> Brian, I think the solution is to add a GenericRelation to your entries
> model;
> seehttp://www.djang
Brian, without knowing exactly how your models are configured, you can do
something like this:
{{ p.comment_set.count }}
If you use it in more than one place (e.g., as {% if p.comment_set.count %}
... {{ p.comment_set.count }} ...), you will want to optimize things so that
the SQL "COUNT()" query
Brian, I think the solution is to add a GenericRelation to your entries
model; see
http://www.djangoproject.com/documentation/contenttypes/#reverse-generic-relationsfor
an explanation. I think that after doing this you'll be able to
access
p.comments.count (assuming that the generic relation is na
Hi Scott,
Thanks for your help, but I'm still having trouble.
I using django-threadedcomments
http://code.google.com/p/django-threadedcomments/
so its a little confusing.
Here are my models
http://dpaste.com/65848/
-Brian
On Jul 18, 12:01 pm, "Scott Moonen" <[EMAIL PROTECTED]> wrote:
> Brian,
I have two tables, one is entries and the other is comments.
In the template I would like display how many comments for each entry
and some other entry data.
So far I have...
view:
entries_list = entries.objects.filter( ...)
template:
{% for p in object_list %}
{{ p.na
5 matches
Mail list logo