Counting comments for a list of posts

2008-11-12 Thread Jason K
I would have thought this would be a simple thing, but I'm at a loss as to how to go about it.. I'm displaying a list of posts by a particular user, and trying to find a way of getting the comment count for each post to display, without hitting the database for each post in the list to count it's

Post count in blog archive month list

2008-06-08 Thread Jason K
So I'm building the archive pages for a blog. In the sidebar I have a list of months that contain posts, linking to the archive month page. I've made an inclusion tag for this which uses Article.objects.dates('pub_date', 'month', order='DESC'). Pretty standard stuff. I'm having a hard time figurin

Re: Problem regouping date list

2008-05-11 Thread Jason K
Beautiful, works perfectly! Thanks, Jason On May 11, 4:57 pm, Adi Jörg Sieker <[EMAIL PROTECTED]> wrote: > Hi, Jason, > > On 11.05.2008, at 16:46, Jason K wrote: > > > > > Hi, having a little trouble regrouping a date list. > > I have an simple inclusion ta

Problem regouping date list

2008-05-11 Thread Jason K
Hi, having a little trouble regrouping a date list. I have an simple inclusion tag to get a unique list of months, as follows: def show_month_list(): month_list = Article.objects.dates('pub_date', 'month', order='DESC') return {'month_list': month_list} register.inclusion_tag('blog/_month

Grouping problem

2008-02-04 Thread Jason K
Hi, just getting to grips with django basics, and stumbling over this little problem.. I have a list of categories, some of which are sub categories, the model looks something like this: name = models.CharField(max_length=30) slug = models.SlugField(prepopulate_from=("name",)) parent = models.For