Re: Filtering queryset using two fields in one model

2009-12-08 Thread pbzRPA
Excellent thank you. So the solution is: from django.db.models import F X.objects.filter(id = F('new_id')) Thanks for the help guys. On 8 Gru, 19:38, Boris Schäling wrote: > > -Original Message- > > From: django-users+ow...@googlegroups.com [mailto:django- > >

RE: Filtering queryset using two fields in one model

2009-12-08 Thread Boris Schäling
> -Original Message- > From: django-users+ow...@googlegroups.com [mailto:django- > users+ow...@googlegroups.com] On Behalf Of pbzRPA > Sent: Tuesday, December 08, 2009 7:19 PM > To: Django users > Subject: Filtering queryset using two fields in one model > > Hi, > > I am not sure if

Re: Filtering queryset using two fields in one model

2009-12-08 Thread Peter Sagerson
Assuming you're using Django 1.1, take a look at: http://docs.djangoproject.com/en/1.1/topics/db/queries/#filters-can-reference-fields-on-the-model On Dec 8, 2009, at 10:18 AM, pbzRPA wrote: > Hi, > > I am not sure if this is a really stupid question but how can you > filter a model by