Re: order by problem with foreign key

2007-10-08 Thread MarcoX
Hi karen, I have removed the attribute null=True and now it works fine. Thank you. On 8 Ott, 16:38, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > Looks like you might be hitting: > > http://code.djangoproject.com/ticket/2076(order_by with related table does > not work) > > From the comments in the

Re: order by problem with foreign key

2007-10-08 Thread Karen Tracey
Looks like you might be hitting: http://code.djangoproject.com/ticket/2076 (order_by with related table does not work) >From the comments in there it sounds like your case might work if you did not have the null=True on your ClickCounter ForeignKey in Story, so that might be something to try as a

Re: order by problem with foreign key

2007-10-08 Thread Malcolm Tredinnick
On Mon, 2007-10-08 at 05:48 -0700, MarcoX wrote: > Hi all, > I have 2 models. > > class Story(models.Model): > title = models.CharField(maxlength=150,core=True) > . > counter = > models.ForeignKey(ClickCounter,edit_inline=models.STACKED,num_in_admin=0,blank=True,null=True) > > class

order by problem with foreign key

2007-10-08 Thread MarcoX
Hi all, I have 2 models. class Story(models.Model): title = models.CharField(maxlength=150,core=True) . counter = models.ForeignKey(ClickCounter,edit_inline=models.STACKED,num_in_admin=0,blank=True,null=True) class ClickCounter(models.Model): number_views = models.IntegerField(d