I'm not saying it's the best way, but I would either define my own
get_comment_count in my application's models.py that looped through
the ojbects comments (and their comments) to get an accurate count.

OR

I would store comment_count locally on the object and send a signal
when a comment is saved, something like (and excuse the pseudo-code)
if this.parent = object or this.parent.parent = object: comment.count
+= 1



On Apr 12, 2:18 pm, fuxter <fuxt...@gmail.com> wrote:
> hey everyone,
> i'm a young django user and need some advice or opinions on the way of
> general use.
>
> in my application (blog-like site) i have objects and they can have
> comments. i also decided to implement limited comment reply feature.
> so the objects can have comments, and those comments can have comments
> as well. it turn out to be one level nested comments. comments for
> comments can't have replies.
>
> at this point i'm stuck with get_comment_count template tag that
> returns only object's comments count, naturally. and i need to count
> all the replies altogether.
>
> so my question is how would you do that? should i add a method to
> commented object that would count all the replies? maybe i could hack
> the comments/templatetags framework? or should i write my own
> templatetag?
>
> i guess all the options are pretty usable and they don't cross the
> django way, which is very liberal. i just wanted to know you opinion,
> what would you prefer?
>
> ps: pardon my russian =)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to