Re: [Django] #11052: Q-Object disjunction join promotion .. bug

2011-06-10 Thread Django
#11052: Q-Object disjunction join promotion .. bug
-+-
   Reporter:  emulbreh   |  Owner:  mtredinnick
   Type:  Bug| Status:  closed
  Milestone:  1.3|  Component:  Database layer
Version:  SVN|  (models, ORM)
 Resolution:  duplicate  |   Severity:  Normal
   Triage Stage:  Accepted   |   Keywords:  m2m, join, null, q
Needs documentation:  0  |  Has patch:  1
Patch needs improvement:  1  |Needs tests:  1
  UI/UX:  0  |  Easy pickings:  0
-+-
Changes (by ethlinn):

 * status:  assigned => closed
 * ui_ux:   => 0
 * resolution:   => duplicate
 * easy:   => 0


Comment:

 The problem is solved by the patch for #14876.

-- 
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] #11052: Q-Object disjunction join promotion .. bug

2011-04-13 Thread Django
#11052: Q-Object disjunction join promotion .. bug
-+-
   Reporter:  emulbreh   |Owner:  mtredinnick
   Type:  Bug|   Status:  assigned
  Milestone:  1.3|Component:  Database layer
Version:  SVN|  (models, ORM)
 Resolution: | Severity:  Normal
   Triage Stage:  Accepted   | Keywords:  m2m, join, null, q
Needs documentation:  0  |Has patch:  1
Patch needs improvement:  1  |  Needs tests:  1
-+-

Comment (by dcwatson):

 I think the problem I described in the post above is actually slightly
 different than this issue, so I've opened a new ticket: #15823

-- 
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] #11052: Q-Object disjunction join promotion .. bug

2011-04-13 Thread Django
#11052: Q-Object disjunction join promotion .. bug
-+-
   Reporter:  emulbreh   |Owner:  mtredinnick
   Type:  Bug|   Status:  assigned
  Milestone:  1.3|Component:  Database layer
Version:  SVN|  (models, ORM)
 Resolution: | Severity:  Normal
   Triage Stage:  Accepted   | Keywords:  m2m, join, null, q
Needs documentation:  0  |Has patch:  1
Patch needs improvement:  1  |  Needs tests:  1
-+-
Changes (by dcwatson):

 * type:   => Bug
 * severity:   => Normal


Comment:

 Another description of the problem and code to reproduce it is here:
 https://groups.google.com/d/msg/django-developers/4wMNF61oQNM/hqspS-Jp5rwJ

-- 
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] #11052: Q-Object disjunction join promotion .. bug

2010-10-15 Thread Django
#11052: Q-Object disjunction join promotion .. bug
---+
  Reporter:  emulbreh  | Owner:  
mtredinnick   
Status:  assigned  | Milestone:  1.3
   
 Component:  Database layer (models, ORM)  |   Version:  SVN
   
Resolution:|  Keywords:  m2m, join, 
null, q
 Stage:  Accepted  | Has_patch:  1  
   
Needs_docs:  0 |   Needs_tests:  1  
   
Needs_better_patch:  1 |  
---+
Changes (by dcwatson):

 * cc: dcwatson (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-upda...@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] #11052: Q-Object disjunction join promotion .. bug

2010-08-05 Thread Django
#11052: Q-Object disjunction join promotion .. bug
---+
  Reporter:  emulbreh  | Owner:  
mtredinnick   
Status:  assigned  | Milestone:  1.3
   
 Component:  Database layer (models, ORM)  |   Version:  SVN
   
Resolution:|  Keywords:  m2m, join, 
null, q
 Stage:  Accepted  | Has_patch:  1  
   
Needs_docs:  0 |   Needs_tests:  1  
   
Needs_better_patch:  1 |  
---+
Changes (by bronger):

 * cc: bronger (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-upda...@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] #11052: Q-Object disjunction join promotion .. bug

2010-08-05 Thread Django
#11052: Q-Object disjunction join promotion .. bug
---+
  Reporter:  emulbreh  | Owner:  
mtredinnick   
Status:  assigned  | Milestone:  1.3
   
 Component:  Database layer (models, ORM)  |   Version:  SVN
   
Resolution:|  Keywords:  m2m, join, 
null, q
 Stage:  Accepted  | Has_patch:  1  
   
Needs_docs:  0 |   Needs_tests:  1  
   
Needs_better_patch:  1 |  
---+
Comment (by bronger):

 I confirm the observation of comment:7 by mucisland.

 Apparently, if a foreign key can't be followed because it's NULL, the Q
 object returns True if used in an "exclude".

-- 
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-upda...@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] #11052: Q-Object disjunction join promotion .. bug

2010-07-22 Thread Django
#11052: Q-Object disjunction join promotion .. bug
---+
  Reporter:  emulbreh  | Owner:  
mtredinnick   
Status:  assigned  | Milestone:  1.3
   
 Component:  Database layer (models, ORM)  |   Version:  SVN
   
Resolution:|  Keywords:  m2m, join, 
null, q
 Stage:  Accepted  | Has_patch:  1  
   
Needs_docs:  0 |   Needs_tests:  1  
   
Needs_better_patch:  1 |  
---+
Comment (by rcarton):

 I am unsure this is related but:

 {{{
 In [81]: PullPending.objects.exclude(~Q(id__in=[])).count()
 Out[81]: 53

 In [82]: PullPending.objects.exclude(~Q(id__in=[]) & Q(id__gt=-1)).count()
 Out[82]: 0
 }}}

 Correct me if I'm wrong:

  1. should return 0 (exclude any object whose id is ''not'' in an empty
 dict, hence exclude all the objects)
  1. should return 0 too, the only difference is like q1 & q2 where q2 is
 always true.

 As I understand it:

  * exclude('True') -> does not exclude
  * exclude('True' and 'True') -> does exclude.

-- 
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-upda...@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] #11052: Q-Object disjunction join promotion .. bug

2010-04-02 Thread Django
#11052: Q-Object disjunction join promotion .. bug
---+
  Reporter:  emulbreh  | Owner:  
mtredinnick   
Status:  assigned  | Milestone:  1.3
   
 Component:  Database layer (models, ORM)  |   Version:  SVN
   
Resolution:|  Keywords:  m2m, join, 
null, q
 Stage:  Accepted  | Has_patch:  1  
   
Needs_docs:  0 |   Needs_tests:  1  
   
Needs_better_patch:  1 |  
---+
Comment (by mucisland):

 #13198 describes the behaviour which emulbreh named "probably a different
 bug" in his observation:
 {{{
 >>> # probably a different bug:
 >>> A.objects.exclude(Q(bs__name__contains="foo"))
 []
 >>> A.objects.exclude(bs__name__contains="foo")
 [, ]
 }}}
 Well, #13198 has been closed and I learned that this is terminal. I just
 wanted to point out a last time that exclude() does not work as one would
 expect when using it with Q.

-- 
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-upda...@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] #11052: Q-Object disjunction join promotion .. bug

2010-03-24 Thread Django
#11052: Q-Object disjunction join promotion .. bug
---+
  Reporter:  emulbreh  | Owner:  
mtredinnick   
Status:  assigned  | Milestone:  1.3
   
 Component:  Database layer (models, ORM)  |   Version:  SVN
   
Resolution:|  Keywords:  m2m, join, 
null, q
 Stage:  Accepted  | Has_patch:  1  
   
Needs_docs:  0 |   Needs_tests:  1  
   
Needs_better_patch:  1 |  
---+
Comment (by russellm):

 #13198 is another report, with two test cases for the problem (or, at
 least a very similar problem).

-- 
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-upda...@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] #11052: Q-Object disjunction join promotion .. bug

2010-03-10 Thread Django
#11052: Q-Object disjunction join promotion .. bug
---+
  Reporter:  emulbreh  | Owner:  
mtredinnick   
Status:  assigned  | Milestone:  1.3
   
 Component:  Database layer (models, ORM)  |   Version:  SVN
   
Resolution:|  Keywords:  m2m, join, 
null, q
 Stage:  Accepted  | Has_patch:  1  
   
Needs_docs:  0 |   Needs_tests:  1  
   
Needs_better_patch:  1 |  
---+
Changes (by russellm):

  * milestone:  1.2 => 1.3

Comment:

 Not critical for 1.2

-- 
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-upda...@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] #11052: Q-Object disjunction join promotion .. bug

2010-02-04 Thread Django
#11052: Q-Object disjunction join promotion .. bug
---+
  Reporter:  emulbreh  | Owner:  
mtredinnick   
Status:  assigned  | Milestone:  1.2
   
 Component:  Database layer (models, ORM)  |   Version:  SVN
   
Resolution:|  Keywords:  m2m, join, 
null, q
 Stage:  Accepted  | Has_patch:  1  
   
Needs_docs:  0 |   Needs_tests:  1  
   
Needs_better_patch:  1 |  
---+
Changes (by emulbreh):

  * milestone:  => 1.2

-- 
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-upda...@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] #11052: Q-Object disjunction join promotion .. bug

2009-10-25 Thread Django
#11052: Q-Object disjunction join promotion .. bug
---+
  Reporter:  emulbreh  | Owner:  
mtredinnick   
Status:  assigned  | Milestone: 
   
 Component:  Database layer (models, ORM)  |   Version:  SVN
   
Resolution:|  Keywords:  m2m, join, 
null, q
 Stage:  Accepted  | Has_patch:  1  
   
Needs_docs:  0 |   Needs_tests:  1  
   
Needs_better_patch:  1 |  
---+
Changes (by emulbreh):

  * needs_better_patch:  0 => 1
  * has_patch:  0 => 1
  * needs_tests:  0 => 1

Comment:

 The patch changes `Query.promote_alias()` to actually look at the LHS of
 the join as its docstring suggests.
 I'm not sure if this is the right approach or even the right place to
 handle this bug.

 === Observation: ===
 {{{
 #!pycon
 >>> A.objects.filter(q0 | q2 | q1)
 []
 >>> A.objects.filter(q0 | q1 | q2)
 []
 >>> # probably a different bug:
 >>> A.objects.exclude(Q(bs__name__contains="foo"))
 []
 >>> A.objects.exclude(bs__name__contains="foo")
 [, ]
 }}}

-- 
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] #11052: Q-Object disjunction join promotion .. bug

2009-08-06 Thread Django
#11052: Q-Object disjunction join promotion .. bug
---+
  Reporter:  emulbreh  | Owner:  
mtredinnick   
Status:  assigned  | Milestone: 
   
 Component:  Database layer (models, ORM)  |   Version:  SVN
   
Resolution:|  Keywords:  m2m, join, 
null, q
 Stage:  Accepted  | Has_patch:  0  
   
Needs_docs:  0 |   Needs_tests:  0  
   
Needs_better_patch:  0 |  
---+
Changes (by Alex):

  * stage:  Unreviewed => Accepted

-- 
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] #11052: Q-Object disjunction join promotion .. bug

2009-05-08 Thread Django
#11052: Q-Object disjunction join promotion .. bug
---+
  Reporter:  emulbreh  | Owner:  
mtredinnick   
Status:  assigned  | Milestone: 
   
 Component:  Database layer (models, ORM)  |   Version:  SVN
   
Resolution:|  Keywords:  m2m, join, 
null, q
 Stage:  Unreviewed| Has_patch:  0  
   
Needs_docs:  0 |   Needs_tests:  0  
   
Needs_better_patch:  0 |  
---+
Changes (by mtredinnick):

  * owner:  nobody => mtredinnick
  * needs_better_patch:  => 0
  * status:  new => assigned
  * 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] #11052: Q-Object disjunction join promotion .. bug

2009-05-08 Thread Django
#11052: Q-Object disjunction join promotion .. bug
--+-
 Reporter:  emulbreh  |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Database layer (models, ORM)  | Version:  SVN   
 Keywords:  m2m, join, null, q|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 (someone who understands why this fails should fix the summary)

 Here's a minimal test:
 {{{
 #!python
 from unittest import TestCase
 from django.db import models

 class A(models.Model):
 name = models.CharField(max_length=30)
 bs = models.ManyToManyField('B')

 class B(models.Model):
 name = models.CharField(max_length=30)
 c = models.ForeignKey('C')

 class C(models.Model):
 name = models.CharField(max_length=30)

 class ABCTest(TestCase):
 def test(self):
 c = C.objects.create(name='the c')
 b = B.objects.create(c=c, name='the b')
 a_with_b = A.objects.create(name='a with b')
 a_with_b.bs.add(b)
 a_without_b = A.objects.create(name='a without b')

 q0 = models.Q(name__contains='without')
 q1 = models.Q(bs__name__contains='foo')
 q2 = models.Q(bs__c__name__contains='foo')

 self.assertEqual([a_without_b], list(A.objects.filter(q0)))
 self.assertEqual([a_without_b], list(A.objects.filter(q0 | q1)))
 self.assertEqual([a_without_b], list(A.objects.filter(q0 | q2)))

 # this fails:
 self.assertEqual([a_without_b], list(A.objects.filter(q0 | q1 |
 q2)))

 }}}
 The offensive query (edited for readabiliy):
 {{{
 #!sql
 SELECT a.id, a.name
 FROM a
   LEFT OUTER JOIN a_bs ON (a.id = a_bs.a_id)
   LEFT OUTER JOIN b ON (a_bs.b_id = b.id)
   INNER JOIN c ON (b.c_id = c.id)
 WHERE (a.name LIKE %without% OR b.name LIKE %foo% OR c.name LIKE %foo%)
 }}}

 Obviously this `INNER JOIN` should be a `LEFT OUTER JOIN`.

-- 
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
-~--~~~~--~~--~--~---