Hi,

>
> I'm wondering if there is any way possible to get this value in my
> inclusion tag?

You can use the "extra" method to bring in your entry counts into the
query set. See the following for an example:

http://www.djangoproject.com/documentation/db-api/#extra-select-none-where-none-params-none-tables-none

> I had tried before to store this value in a field, but
> couldn't get it to save, otherwise I would just pass in a field
> 'num_entries' so if anyone can suggest anything, that would be great.

Can you describe what you did that prevented you from saving the
computed count?

Another solution is to batch compute your counts using a shell script
at some frequency. The script could iterate over each category and
recompute its counts and store them.

Yet another solution is to convert your cats queryset to a list, loop
over it to get an entry count, and then sort the list in Python to
pass on to your template.

So there seem to be many ways to skin this cat.

-Rajesh Dhawan
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to