Re: [Django] #22876: Related lookups allow models of a different type

2014-06-20 Thread Django
#22876: Related lookups allow models of a different type
-+-
 Reporter:  bendavis78   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:  duplicate
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by bendavis78):

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


Comment:

 Yep, the proposed patch there fixes the issue. Closing.

-- 
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/068.f705733fac5511b93e638e390e240cb5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #22876: Related lookups allow models of a different type

2014-06-20 Thread Django
#22876: Related lookups allow models of a different type
-+-
 Reporter:  bendavis78   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timo):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Duplicate of #14334, I think.

-- 
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/068.21a87e6cd2a1f5d6514eb6d50736b16d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #22876: Related lookups allow models of a different type

2014-06-20 Thread Django
#22876: Related lookups allow models of a different type
--+
 Reporter:  bendavis78|  Owner:  nobody
 Type:  Bug   | Status:  new
Component:  Database layer (models, ORM)  |Version:  master
 Severity:  Normal|   Keywords:
 Triage Stage:  Unreviewed|  Has patch:  0
Easy pickings:  0 |  UI/UX:  0
--+
 Django currently allows this:

 {{{
 #!python
 >>> pig = Pig.objects.get(pk=1)
 >>> duck = Duck.objects.get(pk=1)
 >>> ducklings = Duckling.objects.filter(mother_duck=pig)
 [, ]
 }}}

 Unfortunately this can lead to baby ducklings being adopted by pigs.

 A commit was made last year that was intended to fix this (
 changeset:7cca8d5 ), but the test doesn't seem to be written correctly. It
 should assert that the resulting queryset is ''empty'', not populated with
 `ob`:

 {{{
 #!diff
 diff --git a/tests/queries/tests.py b/tests/queries/tests.py
 index 60d1083..cb615bb 100644
 --- a/tests/queries/tests.py
 +++ b/tests/queries/tests.py
 @@ -3247,10 +3247,16 @@ class RelatedLookupTypeTests(TestCase):
  # be a good idea...
  self.assertQuerysetEqual(
  ObjectB.objects.filter(objecta=wrong_type),
 -[ob], lambda x: x)
 +[], lambda x: x)
  self.assertQuerysetEqual(
  ObjectB.objects.filter(objecta__in=[wrong_type]),
 -[ob], lambda x: x)
 +[], lambda x: x)
 }}}

-- 
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/053.dd6b720cbb8a22b1a879885b9f2b37af%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.