> > Use F() objects:
>
> > MyModel.objects.filter(mother=F(top))
Excellent, thanks!
Odd-R.
--
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,
On Monday, April 18, 2011 11:57:37 AM UTC+1, Daniel Roseman wrote:
>
> On Monday, April 18, 2011 9:10:30 AM UTC+1, o_r wrote:
>>
>> Hello.
>>
>> I have this model:
>>
>> class MyModel(models.Model):
>> string = models.CharField(max_length=96,unique=True,db_index=True)
>> mother=models.F
On Monday, April 18, 2011 9:10:30 AM UTC+1, o_r wrote:
>
> Hello.
>
> I have this model:
>
> class MyModel(models.Model):
> string = models.CharField(max_length=96,unique=True,db_index=True)
> mother=models.ForeignKey('self',null=True,blank=True)
>
> top=models.ForeignKey('self',nul
Hello.
I have this model:
class MyModel(models.Model):
string = models.CharField(max_length=96,unique=True,db_index=True)
mother=models.ForeignKey('self',null=True,blank=True)
top=models.ForeignKey('self',null=True,blank=True,related_name="Top")
I need to make a query which will return
4 matches
Mail list logo