Re: Using Aggregate and Count

2013-11-21 Thread Timothy W. Cook
On Thu, Nov 21, 2013 at 8:25 AM, Daniel Roseman wrote: > states that if the value is, or ends with, "+", then no reverse relationship > will be created. I'm not sure why you are doing that, but remove the "+" > from the related_name in the ForeignKey definition. Thanks for pointing this out. I k

Re: Using Aggregate and Count

2013-11-21 Thread Daniel Roseman
On Thursday, 21 November 2013 00:49:52 UTC, Timothy W. Cook wrote: > > Does the fact that I use a relat_name on the Review.paper field have > anything to do with it not working? > > In the Review model, notice: > paper = models.ForeignKey(Paper, verbose_name=_('Paper'), > related_name="%(app_la

Re: Using Aggregate and Count

2013-11-20 Thread Timothy W. Cook
Does the fact that I use a relat_name on the Review.paper field have anything to do with it not working? In the Review model, notice: paper = models.ForeignKey(Paper, verbose_name=_('Paper'), related_name="%(app_label)s_%(class)s_related+", null=False, blank=False, help_text=_("Select a paper."))

Re: Using Aggregate and Count

2013-11-20 Thread Timothy W. Cook
Thanks DAniel. The models: class Review(models.Model): """ A review of one paper.""" INCLUDE_CHOICES = [(True,'Include'),(False,'Exclude')] paper = models.ForeignKey(Paper, verbose_name=_('Paper'), related_name="%(app_label)s_%(class)s_related+", null=False, blank=False, help_text=_("

Re: Using Aggregate and Count

2013-11-20 Thread Daniel Roseman
On Wednesday, 20 November 2013 20:04:13 UTC, Timothy W. Cook wrote: > > Hi Daniel, > > On Wed, Nov 20, 2013 at 5:47 PM, Daniel Roseman > > > wrote: > > On Wednesday, 20 November 2013 19:11:26 UTC, Timothy W. Cook wrote: > > > > > You're accessing a `review_count` attribute via each Paper inst

Re: Using Aggregate and Count

2013-11-20 Thread Timothy W. Cook
Hi Daniel, On Wed, Nov 20, 2013 at 5:47 PM, Daniel Roseman wrote: > On Wednesday, 20 November 2013 19:11:26 UTC, Timothy W. Cook wrote: > > You're accessing a `review_count` attribute via each Paper instance, but you > haven't set up anything that would do that - you only have a single > top-lev

Re: Using Aggregate and Count

2013-11-20 Thread Daniel Roseman
On Wednesday, 20 November 2013 19:11:26 UTC, Timothy W. Cook wrote: > > I see there was a similar question on this issue earlier today but > alas it didn't answer my question. > > In my app I have models for: > Project: a project (not really part of this question but used for > context in the