#14008: GeoDjango subquery fails with bad quoting ---------------------------------+------------------------------------------ Reporter: Matthew | Owner: nobody Status: new | Milestone: Component: GIS | Version: 1.2 Resolution: | Keywords: Stage: Unreviewed | Has_patch: 0 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | ---------------------------------+------------------------------------------ Comment (by jbronn):
What version of Django are you using? This is very similar to #11741 & #12828, which were both fixed a while ago. Using trunk, SQL that's generated for me is: {{{ SELECT "bugs_code"."id", "bugs_code"."area_id", "bugs_code"."type", "bugs_code"."code" FROM "bugs_code" WHERE "bugs_code"."area_id" IN (SELECT U0."id" FROM "bugs_area" U0 INNER JOIN "bugs_geometry" U1 ON (U0."id" = U1."area_id") WHERE (ST_Contains(U1."polygon", ST_GeomFromEWKB(E'\\001\\001\\000\\000 4l\\000\\000\\000\\000\\000\\000\\000j\\030A\\000\\000\\000\\000\\200O\\022A'::bytea)) AND U0."generation_low_id" <= 13 AND U0."generation_high_id" >= 13 )) }}} Notice `U1` is not quoted. Will close this as a duplicate unless I'm convinced otherwise. -- Ticket URL: <http://code.djangoproject.com/ticket/14008#comment:2> Django <http://code.djangoproject.com/> 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.