Re: [Django] #16781: Wrong SQL for a query-set

2013-11-02 Thread Django
#16781: Wrong SQL for a query-set
-+-
 Reporter:  Kronuz   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.3
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by akaariai):

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


Comment:

 I've tested that this doesn't generate breaking SQL, and that the attached
 tests pass when fixed (the test_ticket16781_same_reverse_field() test
 wasn't correct).

 I am not going to add tests for this ticket, I recall there being some
 other test additions in this area (especially for invalid SQL), and adding
 yet three more models to queries/models.py to have a test that is very
 likely a duplicate doesn't feel good to me.

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


Re: [Django] #16781: Wrong SQL for a query-set

2011-12-13 Thread Django
#16781: Wrong SQL for a query-set
-+-
 Reporter:  Kronuz   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.3
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by Kronuz):

 * cc: Kronuz (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] #16781: Wrong SQL for a query-set

2011-09-16 Thread Django
#16781: Wrong SQL for a query-set
-+-
   Reporter:  Kronuz |  Owner:  nobody
   Type:  Bug| Status:  new
  Milestone: |  Component:  Database layer
Version:  1.3|  (models, ORM)
 Resolution: |   Severity:  Normal
   Triage Stage:  Accepted   |   Keywords:
Needs documentation:  0  |  Has patch:  0
Patch needs improvement:  0  |Needs tests:  0
  UI/UX:  0  |  Easy pickings:  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] #16781: Wrong SQL for a query-set

2011-09-10 Thread Django
#16781: Wrong SQL for a query-set
-+-
   Reporter:  Kronuz |  Owner:  nobody
   Type:  Bug| Status:  new
  Milestone: |  Component:  Database layer
Version:  1.3|  (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 jamesp):

 Oops, looked again, looks like it should be in regressions :)

-- 
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] #16781: Wrong SQL for a query-set

2011-09-10 Thread Django
#16781: Wrong SQL for a query-set
-+-
   Reporter:  Kronuz |  Owner:  nobody
   Type:  Bug| Status:  new
  Milestone: |  Component:  Database layer
Version:  1.3|  (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 jamesp):

 Duplicated issue.  It occurs when a reverse lookup is chained with the
 field it is reversing...?

 (Total newbie, had a hard time expressing what exactly was being queried
 here, and I hope the test is located in the correct spot.)

 It works fine when the reverse lookups are chained from different fields.

-- 
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] #16781: Wrong SQL for a query-set

2011-09-09 Thread Django
#16781: Wrong SQL for a query-set
-+-
   Reporter:  Kronuz |  Owner:  nobody
   Type:  Bug| Status:  new
  Milestone: |  Component:  Database layer
Version:  1.3|  (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 anonymous):

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


Comment:

 This bug could be related to #9188

-- 
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] #16781: Wrong SQL for a query-set

2011-09-09 Thread Django
#16781: Wrong SQL for a query-set
+--
 Reporter:  Kronuz  |  Owner:  nobody
 Type:  Bug | Status:  new
Milestone:  |  Component:  Database layer (models, ORM)
  Version:  1.3 |   Severity:  Normal
 Keywords:  |   Triage Stage:  Unreviewed
Has patch:  0   |  Easy pickings:  0
UI/UX:  0   |
+--
 I'm using Django 1.3 and the postgres (postgresql_psycopg2) backend. A
 query set is producing the wrong (invalid) SQL.

 Query that breaks the SQL:
 `Address.objects.exclude(user__relationships_from__from_user__id=100)`
 Resulting in:
 {{{
 #!div style="font-size: 80%"
 Code highlighting:
   {{{#!sql
 SELECT "bug3_address"."id", "bug3_address"."user_id",
 "bug3_address"."address" FROM "bug3_address" WHERE NOT
 ("bug3_address"."user_id" IN (SELECT U2."from_user_id" FROM
 "entities_user" U1 WHERE (U0."user_id" = 100  AND U2."from_user_id" IS NOT
 NULL)))
   }}}
 }}}

 However, this works fine:
 `Address.objects.exclude(user__relationships_to__from_user__id=100)`
 Resulting in:
 {{{
 #!div style="font-size: 80%"
 Code highlighting:
   {{{#!sql
 SELECT "bug3_address"."id", "bug3_address"."user_id",
 "bug3_address"."address" FROM "bug3_address" WHERE NOT
 (("bug3_address"."user_id" IN (SELECT U2."to_user_id" FROM
 "bug3_relationship" U2 WHERE (U2."from_user_id" = 100  AND U2."to_user_id"
 IS NOT NULL)) AND "bug3_address"."user_id" IS NOT NULL))
   }}}
 }}}


 Also accessing other attributes works fine:
 `Address.objects.exclude(user__relationships_from__status='A')`
 Resulting in:
 {{{
 #!div style="font-size: 80%"
 Code highlighting:
   {{{#!sql
 SELECT "bug3_address"."id", "bug3_address"."user_id",
 "bug3_address"."address" FROM "bug3_address" WHERE NOT
 (("bug3_address"."user_id" IN (SELECT U2."from_user_id" FROM
 "bug3_relationship" U2 WHERE (U2."status" = A  AND U2."from_user_id" IS
 NOT NULL)) AND "bug3_address"."user_id" IS NOT NULL))
   }}}
 }}}


 These are the models:
 {{{
 #!div style="font-size: 80%"
 Code highlighting:
   {{{#!python

 from django.db import models
 from django.contrib.auth.models import User

 class Address(models.Model):
 user = models.ForeignKey(User)
 address = models.CharField(max_length=100)

 class Relationship(models.Model):
 status = models.CharField(max_length=1)
 from_user = models.ForeignKey(User, related_name='relationships_from')
 to_user = models.ForeignKey(User, related_name='relationships_to')
   }}}
 }}}

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