#12885: GenericRelation fails to join the related table from a inherited model
---------------------------------------------------+------------------------
Reporter: semenov | Owner: nobody
Status: new | Milestone:
Component: Database layer (models, ORM) | Version: 1.1
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Comment (by semenov):
The SQL query is a bit different in SVN trunk, but still results in the
same error ("Unknown column 'T2.object_id' in 'where clause'").
SQL query in Django 1.1.1:
{{{
SELECT `tracker_car`.`id`, `tracker_car`.`content_type_id`,
`tracker_car`.`object_id`, `tracker_truck`.`car_ptr_id`
FROM `tracker_truck`
INNER JOIN `tracker_truck` T2 ON (`tracker_truck`.`car_ptr_id` = T2.`id`)
INNER JOIN `tracker_car` ON (`tracker_truck`.`car_ptr_id` =
`tracker_car`.`id`)
WHERE T2.`object_id` = 1 LIMIT 21
}}}
SQL query in Django-SVN r12453:
{{{
SELECT `tracker_car`.`id`, `tracker_car`.`content_type_id`,
`tracker_car`.`object_id`, `tracker_truck`.`car_ptr_id`
FROM `tracker_truck`
INNER JOIN `tracker_truck` T2 ON (`tracker_truck`.`car_ptr_id` =
T2.`car_ptr_id`)
INNER JOIN `tracker_car` ON (`tracker_truck`.`car_ptr_id` =
`tracker_car`.`id`)
WHERE T2.`object_id` = 1 LIMIT 21
}}}
(By the way, I am also confused by the magic number 21, but that's
irrelevant to the topic.)
--
Ticket URL: <http://code.djangoproject.com/ticket/12885#comment:3>
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.