On Thu, Apr 14, 2011 at 11:46 AM, Massimiliano della Rovere
wrote:
> what about Parent.objects.filter(~q) ?
In [16]: f1 = Parent.objects.filter(~q)
In [17]: print f1.query
SELECT "molserv_parent"."id", "molserv_parent"."name" FROM
"molserv_parent" WHERE NOT ("molserv_parent"."id" IN (SELECT
U1."
what about Parent.objects.filter(~q) ?
On Thu, Apr 14, 2011 at 11:08, Gianluca Sforna wrote:
> On Wed, Apr 13, 2011 at 3:43 PM, Brian Bouterse wrote:
>> Could you include the output to highlight the differences?
>
> I've just created a simpler test case. I've a couple models like:
>
> class Par
On Wed, Apr 13, 2011 at 3:43 PM, Brian Bouterse wrote:
> Could you include the output to highlight the differences?
I've just created a simpler test case. I've a couple models like:
class Parent(models.Model):
name = models.CharField(max_length=200, db_index=True)
class Child(models.Model):
Could you include the output to highlight the differences?
Brian
On Wed, Apr 13, 2011 at 9:32 AM, Gianluca Sforna wrote:
> In writing a complex filter for an application, I've found a different
> behavior between a filter like:
> Model.objects.exclude(filter1, filter2)
>
> and one like:
> Model
In writing a complex filter for an application, I've found a different
behavior between a filter like:
Model.objects.exclude(filter1, filter2)
and one like:
Model.objects.exclude(Q(filter1), Q(filter2))
where filter1 and filter2 are both field lookups on related models; in
particular only the sec
5 matches
Mail list logo