#11263: Bug in lookup with generic relation in model inheritance
---------------------------------------------------+------------------------
Reporter: veena | Owner: tobias
Status: assigned | Milestone: 1.2
Component: Database layer (models, ORM) | Version: SVN
Resolution: | Keywords: generic
relations, model inheritance
Stage: Accepted | Has_patch: 0
Needs_docs: 1 | Needs_tests: 1
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Comment (by tobias):
verified that WITHOUT inheritance this works OK:
{{{
class Order(models.Model):
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey()
status = models.CharField(max_length=10, default='ordered')
class Visitor(models.Model): # DOES NOT have parent model
order = generic.GenericRelation(Order)
}}}
{{{
SELECT COUNT(*)
FROM "testapp_visitor"
INNER JOIN "testapp_order" ON ("testapp_visitor"."id" =
"testapp_order"."object_id")
WHERE ("testapp_order"."status" = E\'ordered\' AND
"testapp_order"."content_type_id" = 9 )
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/11263#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
-~----------~----~----~----~------~----~------~--~---