Re: [Django] #22221: Wrong join promotion on ManyToManyField to self with an intermediate model.

2014-03-06 Thread Django
#1: Wrong join promotion on ManyToManyField to self with an intermediate 
model.
-+-
 Reporter:  loic84   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:  invalid
 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 akaariai):

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


Comment:

 The problem seems to be using the wrong direction in the query. The
 rel_from_set in tony.friends.filter(rel_from_set...) refers to the
 *friend's* rel_from_set. That is, it refers to Chris' rel_from_set, and
 chris isn't the first friend in the relation. I believe the correct query
 is tony.friend.filter(rel_to_set...). Closing as invalid, do reopen if my
 analysis seems wrong.

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


Re: [Django] #22221: Wrong join promotion on ManyToManyField to self with an intermediate model.

2014-03-06 Thread Django
#1: Wrong join promotion on ManyToManyField to self with an intermediate 
model.
-+-
 Reporter:  loic84   |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
-+-

Comment (by akaariai):

 I don't see how this is a join promotion issue - why should joins be left
 joins in the generated SQL for the test case? Both joined fields are
 checked for equality in the WHERE clause. Left joins can't give more
 results as the WHERE clause can't match if either T4 or
 m2m_through_friendship are NULL.

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


Re: [Django] #22221: Wrong join promotion on ManyToManyField to self with an intermediate model.

2014-03-06 Thread Django
#1: Wrong join promotion on ManyToManyField to self with an intermediate 
model.
-+-
 Reporter:  loic84   |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 loic84):

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


Comment:

 Failing testcase: https://github.com/loic/django/compare/ticket1.

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


[Django] #22221: Wrong join promotion on ManyToManyField to self with an intermediate model.

2014-03-06 Thread Django
#1: Wrong join promotion on ManyToManyField to self with an intermediate 
model.
--+
 Reporter:  loic84|  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
--+
 Generated SQL:

 {{{#!sql
 SELECT "m2m_through_personselfrefm2m"."id",
 "m2m_through_personselfrefm2m"."name"
 FROM "m2m_through_personselfrefm2m"
 INNER JOIN "m2m_through_friendship" ON (
 "m2m_through_personselfrefm2m"."id" = "m2m_through_friendship"."second_id"
 )
 INNER JOIN "m2m_through_friendship" T4 ON (
 "m2m_through_personselfrefm2m"."id" = T4."first_id" )
 WHERE ("m2m_through_friendship"."first_id" = 1 AND T4."reason" =
 'because')
 }}}

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