Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-02-08 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  charettes
 Type:  Bug  |   Status:  closed
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:  fixed
  none   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Anssi Kääriäinen ):

 In [changeset:"f4132140f52c88b67d11743d4062a9d455959ffc"]:
 {{{
 #!CommitTicketReference repository=""
 revision="f4132140f52c88b67d11743d4062a9d455959ffc"
 [1.5.x] Fixed #19652 -- Fixed .none() regression in related fields

 The regression was caused by using .none() when querying for related
 models, and the origin field's value was None. This resulted in missing
 custom related manager subclass as .none() returns plain QuerySet.

 This isn't backport from master, in master .none() correctly preserves
 the queryset's class.

 Patch provided by Simon Charette, with some minor polish by committer.
 }}}

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-02-08 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  charettes
 Type:  Bug  |   Status:  closed
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:  fixed
  none   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Aymeric Augustin ):

 In [changeset:"9328ef0e84db2559af56d24c40e6b24b74e29a6f"]:
 {{{
 #!CommitTicketReference repository=""
 revision="9328ef0e84db2559af56d24c40e6b24b74e29a6f"
 [1.5.x] Avoided a possible regression in 5097d3c5.

 QuerySet.none() returns an instance of EmptyQuerySet, which may have
 undesirable side effects in the presence of custom query set classes.

 The implementation of .none() was refactored in master to have the same
 effect as .filter(pk__in=[]).

 Refs #19652.

 Thanks Simon Charrette for the report.
 }}}

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-01-22 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  charettes
 Type:  Bug  |   Status:  closed
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:  fixed
  none   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Anssi Kääriäinen ):

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


Comment:

 In [changeset:"f4132140f52c88b67d11743d4062a9d455959ffc"]:
 {{{
 #!CommitTicketReference repository=""
 revision="f4132140f52c88b67d11743d4062a9d455959ffc"
 [1.5.x] Fixed #19652 -- Fixed .none() regression in related fields

 The regression was caused by using .none() when querying for related
 models, and the origin field's value was None. This resulted in missing
 custom related manager subclass as .none() returns plain QuerySet.

 This isn't backport from master, in master .none() correctly preserves
 the queryset's class.

 Patch provided by Simon Charette, with some minor polish by committer.
 }}}

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-01-22 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  charettes
 Type:  Bug  |   Status:  assigned
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:
  none   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by akaariai):

 Every use of .none() pre-1.6 will cause this same bug. This is a "feature"
 of using .none(), and the reason .none() was changed in 1.6. Still, I
 think it is a good idea to fix this one as this is a regression. Existing
 code will fail, and the fix is trivial.

 I will commit the patch to 1.5.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-01-22 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  charettes
 Type:  Bug  |   Status:  assigned
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:
  none   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by charettes):

 * has_patch:  0 => 1


Comment:

 Added a patch based on stable/1.5.x with fix and failing testcase. It
 looks like the regression was introduced by
 
[https://github.com/django/django/commit/9d6d0de7c1704fa39efb1f725bd8f80961ce3496#L0R501
 the fix] for #17541 after all.

 I don't know if we should also add the tests to the master branch.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-01-22 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  charettes
 Type:  Bug  |   Status:  assigned
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:
  none   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by charettes):

 * owner:  akaariai => charettes


Comment:

 I'll tackle it.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-01-22 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  akaariai
 Type:  Bug  |   Status:  assigned
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:
  none   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by akaariai):

 The correct approach seems to be to filter using `pk__in=[]` which ensures
 no query is executed.

 I am too tired to write a patch today. If anybody else wants to tackle
 this I won't object...

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-01-22 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  akaariai
 Type:  Bug  |   Status:  assigned
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:
  none   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by manfre):

 To avoid the NULL = NULL issue, you could just go with a more explicit
 `queryset.filter(Q(pk=1) & ~Q(pk=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 https://groups.google.com/groups/opt_out.




Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-01-22 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  akaariai
 Type:  Bug  |   Status:  assigned
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:
  none   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by akaariai):

 * owner:  nobody => akaariai
 * status:  new => assigned


-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-01-22 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:
  none   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by aaugustin):

 Right, that makes sense.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-01-22 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:
  none   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by akaariai):

 * stage:  Unreviewed => Accepted


Comment:

 A pk can't be NULL, but if you use to_field, then you could have NULLs on
 both sides. We definitely want the semantics of SQL's JOIN ON (lhs.fk_val
 = rhs.to_field). This means that if either/both of those are NULL, then
 the result is "no match". (SQL's funny trinary boolean logic, NULL = NULL
 => UNKNOWN.)

 If we go an try to change this we will have endless amount of problems.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-01-22 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:
  none   | Triage Stage:
Has patch:  0|  Unreviewed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by aaugustin):

 Isn't it technically possible to have a nullable custom foreign key field?
 (There could be at most one object with a null pk.)

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-01-22 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:
  none   | Triage Stage:
Has patch:  0|  Unreviewed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-

Comment (by akaariai):

 The likely fix is to do queryset.filter(pk=None) instead of
 queryset.none(). User visible effect is the same as what is now done 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 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 https://groups.google.com/groups/opt_out.




Re: [Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-01-22 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  ORM aggregation  |  Version:
 Severity:  Release blocker  |  1.5-beta-1
 Keywords:  none EmptyQuerySet   |   Resolution:
  none   | Triage Stage:
Has patch:  0|  Unreviewed
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  0|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by aaugustin):

 * needs_better_patch:   => 0
 * severity:  Normal => Release blocker
 * 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 https://groups.google.com/groups/opt_out.




[Django] #19652: Fix for #19524 introduced a backward compatiblity issue with related managers on 1.5.X

2013-01-22 Thread Django
#19652: Fix for #19524 introduced a backward compatiblity issue with related
managers on 1.5.X
-+-
 Reporter:  charettes|  Owner:  nobody
 Type:  Bug  | Status:  new
Component:  ORM aggregation  |Version:  1.5-beta-1
 Severity:  Normal   |   Keywords:  none EmptyQuerySet none
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0|  UI/UX:  0
-+-
 The fix for #19524 which was
 
[https://github.com/django/django/commit/5097d3c5faab2b6582c4cebee2b265fcdbb893eb#L1R698
 backported] to the 1.5.X branch caused the following regression:

 {{{
 #!python
 class ObjectQuerySet(models.query.QuerySet):
 def extra_qs_method(self):
 pass


 class ObjectManager(models.Manager):
 use_for_related_fields = True

 def get_query_set(self):
 return ObjectQuerySet(self.model, using=self._db)


 class RelatedObject(models.Model):
 pass


 class Object(models.Model):
 related = models.ForeignKey(RelatedObject, related_name='objs')

 objects = ObjectManager()


 RelatedObject().objs.extra_qs_method()
 }}}

 Raises

 {{{
 AttributeError: 'EmptyQuerySet' object has no attribute 'extra_qs_method'
 }}}

 It works perfectly on `master` since `QuerySet.none()` returns an instance
 of the correct class while setting it's underlying's query to empty and on
 < 1.5.X since prior to this backport there was no `instance.pk`
 
[https://github.com/django/django/commit/5097d3c5faab2b6582c4cebee2b265fcdbb893eb#L1R695
 check] to return an `EmptyQuerySet`.

-- 
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 https://groups.google.com/groups/opt_out.