Re: [Django] #15145: __in is ignored by an excluded query if foo__in is set to an empty iterable

2014-03-23 Thread Django
#15145: __in is ignored by an excluded query if foo__in is set to an empty 
iterable
-+-
 Reporter:  melinath |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by bmispelon):

 Looks like it was fixed in bd283aa844b04651b7c8b4e85f48c6dced1678f0 (found
 using git bisect).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.889f9566be02fd08bccd68c85573867c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15145: __in is ignored by an excluded query if foo__in is set to an empty iterable

2014-03-22 Thread Django
#15145: __in is ignored by an excluded query if foo__in is set to an empty 
iterable
-+-
 Reporter:  melinath |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by melinath):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 Yeah, seems to be fixed in master. (Going by the test case I presented.)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.b0822f1ae4e281e8b4876bb1598fb674%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15145: __in is ignored by an excluded query if foo__in is set to an empty iterable

2014-02-09 Thread Django
#15145: __in is ignored by an excluded query if foo__in is set to an empty 
iterable
-+-
 Reporter:  melinath |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by reidrac):

 I can't reproduce the issue in master.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.1ef4ea918bf197f5ebfabe82015e8e72%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15145: __in is ignored by an excluded query if foo__in is set to an empty iterable

2011-03-10 Thread Django
#15145: __in is ignored by an excluded query if foo__in is set to an empty 
iterable
-+-
   Reporter:  melinath   |Owner:  nobody
 Status:  new|Milestone:
  Component:  Database   |  Version:  SVN
  layer (models, ORM)| Keywords:
 Resolution: |Has patch:  0
   Triage Stage:  Accepted   |  Needs tests:  0
Needs documentation:  0  |
Patch needs improvement:  1  |
-+-
Changes (by bberes):

 * cc: botondus@… (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15145: __in is ignored by an excluded query if foo__in is set to an empty iterable

2011-02-26 Thread Django
#15145: __in is ignored by an excluded query if foo__in is set to an empty 
iterable
+---
   Reporter:  melinath  | Owner:  nobody
 Status:  new   | Milestone:
  Component:  Database layer (models, ORM)  |   Version:  SVN   
 Resolution:|  Keywords:
   Triage Stage:  Accepted  | Has patch:  0 
Needs documentation:  0 |   Needs tests:  0 
Patch needs improvement:  1 |  
+---
Changes (by GDorn):

  * needs_better_patch:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15145: __in is ignored by an excluded query if foo__in is set to an empty iterable

2011-02-26 Thread Django
#15145: __in is ignored by an excluded query if foo__in is set to an empty 
iterable
+---
   Reporter:  melinath  | Owner:  nobody
 Status:  new   | Milestone:
  Component:  Database layer (models, ORM)  |   Version:  SVN   
 Resolution:|  Keywords:
   Triage Stage:  Accepted  | Has patch:  0 
Needs documentation:  0 |   Needs tests:  0 
Patch needs improvement:  0 |  
+---

Comment (by GDorn):

 Some initial investigation:

 One possible source of the problem is in {{{WhereNode.make_atom()}}}.
 When called on an {{{in}}} lookup with an empty list, it raises an
 {{{EmptyResultSet}}} which drops it from the query entirely.  It should
 first check to see if it is part of an exclude, but I'm not sure that
 information is available at that point.

 This should either be a wontfix (check your list before excluding on it),
 or a not-small refactor of the make_atom/as_sql portion of WhereNode to
 pass state into inner nodes of the tree.

 I'll upload a non-solution patch to illustrate the problem.  This breaks
 one other test, of course:
 {{{aggregation_regress.AggregationTests.test_empty_filter_aggregate}}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15145: __in is ignored by an excluded query if foo__in is set to an empty iterable

2011-01-21 Thread Django
#15145: __in is ignored by an excluded query if foo__in is set to an empty 
iterable
---+
  Reporter:  melinath  | Owner:  nobody
Status:  new   | Milestone:
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #15145: __in is ignored by an excluded query if foo__in is set to an empty iterable

2011-01-21 Thread Django
#15145: __in is ignored by an excluded query if foo__in is set to an empty 
iterable
--+-
 Reporter:  melinath  |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Database layer (models, ORM)  | Version:  SVN   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 Please note that the arguments may be ignored by a filtered query. I
 haven't tested that.

 Assume the following model setup:
 {{{
 #!python
 from django.db import models
 from django.contrib.contenttypes.models import ContentType


 class TestModel1(models.Model):
 content_type = models.ForeignKey(ContentType)
 integer = models.PositiveIntegerField()
 }}}

 Now run the following code:
 {{{
 #!python
 >>> from test.models import TestModel1 # or wherever you're keeping it.
 >>> from django.contrib.contenttypes.models import ContentType
 >>> integer = 1
 >>> ct = ContentType.objects.all()[0]
 >>> TestModel1.objects.create(integer=integer, content_type=ct)
 
 >>> TestModel1.objects.all()
 []
 >>> # This is where it starts getting interesting.
 >>> TestModel1.objects.exclude(content_type=ct, integer__in=[])
 []
 }}}
 According to the documentation, this kind of exclude should exclude all
 rows where the content type is ct AND integer is in the list. Now since
 the list is empty, there should be no rows matching the exclusion, so all
 rows should be returned. Instead, I get an empty queryset.

 Here's a look at the sql being generated by various queries (Line breaks
 added for readability):

 

 {{{TestModel1.objects.all() or TestModel1.objects.exclude(integer__in=[])
 or TestModel1.objects.exclude(content_type__in=[])}}}
 {{{
 #!sql
 SELECT "test_testmodel1"."id", "test_testmodel1"."content_type_id",
 "test_testmodel1"."integer" FROM "test_testmodel1"
 }}}

 

 {{{TestModel1.objects.exclude(integer__in=[2])}}}
 {{{
 #!sql
 SELECT "test_testmodel1"."id", "test_testmodel1"."content_type_id",
 "test_testmodel1"."integer"
 FROM "test_testmodel1" WHERE NOT ("test_testmodel1"."integer" IN (2))
 }}}

 

 {{{TestModel1.objects.exclude(integer__in=[], content_type=ct) or
 TestModel1.objects.exclude(content_type=ct)}}}
 {{{
 #!sql
 SELECT "test_testmodel1"."id", "test_testmodel1"."content_type_id",
 "test_testmodel1"."integer"
 FROM "test_testmodel1" WHERE NOT ("test_testmodel1"."content_type_id" = 1
 )
 }}}

 ---

 {{{TestModel1.objects.exclude(content_type__in=[], integer=1) or
 TestModel1.objects.exclude(integer=1)}}}
 {{{
 #!sql
 SELECT "test_testmodel1"."id", "test_testmodel1"."content_type_id",
 "test_testmodel1"."integer"
 FROM "test_testmodel1" WHERE NOT ("test_testmodel1"."integer" = 1 )

 ---

 As you can see, the __in kwarg is being completely ignored. Unfortunately,
 I can't for the life of me figure out where the bug is happening, or I
 would try to write a patch. In case it's relevant, I'm using a sqlite3
 database.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.