#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: Accepted | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Comment (by semenov):
Just in case, the expected query is:
{{{
SELECT `tracker_car`.`id`, `tracker_car`.`content_type_id`,
`tracker_car`.`object_id`, `tracker_truck`.`car_ptr_id`
FROM `tracker_truck`
INNER JOIN `tracker_car` ON (`tracker_truck`.`car_ptr_id` =
`tracker_car`.`id`)
WHERE `tracker_car`.`object_id` = 1
}}}
- the redundant JOIN to itself removed along with its alias, and there's
no "LIMIT 21".
I will probably look into the related ORM code on the weekend.
--
Ticket URL: <http://code.djangoproject.com/ticket/12885#comment:5>
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.