For example, we have object 'book' and 'vote'. Each vote is assigned
to some book. On page I'd like to know how many votes was for certain
book?

The first solution was to create a methdon in book model:

def get_votes(self):
...... database query here ..... return an integer...

That is the best way now to cache this value? The problem is that I
want to immediately get latests value, so time-depended cache is not
an option. Perhaps, instead of method get_votes I should define an
Integer field and manually update it's value each time someone post
new vote?

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