Are you sure it is not just a property of that question class?
Storing a count property for that answers, and increase it every time got
new response?
It would be faster than go through the entire db for each question.

I am just guessing.


On Thu, Jan 22, 2009 at 1:37 PM, Gath <pgath...@gmail.com> wrote:

>
> In Django how can i return the total number of items (count) that a
> related to another model, e.g the way stackoverflow.com does a list of
> questions then on the side it shows the count on the answers related
> to that question.
>
> This is easy if i get the questionid, i can return all answers related
> to that question but when am displaying the entire list of question it
> becomes a bit tricky to display on the side the count showing the
> total answer count.
>
> I don't know if am clear but just think how www.stackoverflow.com
> displays its questions with answer,views count next to each question!
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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