Re: [Django] #12885: GenericRelation fails to join the related table from a inherited model

6 views
Skip to first unread message

Django

unread,
Feb 1, 2013, 9:04:00 PM2/1/13
to django-...@googlegroups.com
#12885: GenericRelation fails to join the related table from a inherited model
--------------------------------------+------------------------------------
Reporter: semenov | Owner: nobody
Type: Bug | Status: new
Component: contrib.contenttypes | Version: 1.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by ramiro):

See also #13203.

--
Ticket URL: <https://code.djangoproject.com/ticket/12885#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 2, 2015, 3:56:13 PM10/2/15
to django-...@googlegroups.com
#12885: GenericRelation fails to join the related table from a inherited model
--------------------------------------+------------------------------------
Reporter: semenov | Owner: nobody
Type: Bug | Status: new
Component: contrib.contenttypes | Version: 1.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by timgraham):

This remains an issue as of 58c7ff39fb265754fb17ab8d7f8a1401b355777b
(Django 1.10 dev).

Here's the query for the attached failing test:
{{{
SELECT "generic_relations_mineral"."id",
"generic_relations_mineral"."name",
"generic_relations_mineral"."hardness",
"generic_relations_valuablerock"."mineral_ptr_id"
FROM "generic_relations_valuablerock"
INNER JOIN "generic_relations_valuabletaggeditem" ON
("generic_relations_valuablerock"."mineral_ptr_id" =
"generic_relations_valuabletaggeditem"."object_id" AND
("generic_relations_valuabletaggeditem"."content_type_id" = 13))
INNER JOIN "generic_relations_taggeditem" ON
("generic_relations_valuabletaggeditem"."taggeditem_ptr_id" =
"generic_relations_taggeditem"."id")
INNER JOIN "generic_relations_mineral" ON
("generic_relations_valuablerock"."mineral_ptr_id" =
"generic_relations_mineral"."id")
WHERE "generic_relations_taggeditem"."tag" = countertop
}}}
Traceback:
{{{
File "/home/tim/code/django/django/db/backends/sqlite3/base.py", line 323,
in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such column:
generic_relations_valuabletaggeditem.object_id
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/12885#comment:13>

Django

unread,
Oct 2, 2015, 3:56:29 PM10/2/15
to django-...@googlegroups.com
#12885: GenericRelation fails to join the related table from a inherited model
--------------------------------------+------------------------------------
Reporter: semenov | Owner: nobody
Type: Bug | Status: new
Component: contrib.contenttypes | Version: 1.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* Attachment "12885-test.diff" added.


--
Ticket URL: <https://code.djangoproject.com/ticket/12885>

Django

unread,
Oct 27, 2015, 7:21:43 AM10/27/15
to django-...@googlegroups.com
#12885: GenericRelation fails to join the related table from a inherited model
--------------------------------------+------------------------------------
Reporter: semenov | Owner: nobody
Type: Bug | Status: new
Component: contrib.contenttypes | Version: 1.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by akaariai):

* has_patch: 0 => 1


Comment:

I've created a PR for this (see
https://github.com/django/django/pull/5487). Luckily the changes needed
here were only to contrib.contenttypes. This is always a good sign, we
likely don't have a more fundamental problem. Lets see what CI things of
my PR...

--
Ticket URL: <https://code.djangoproject.com/ticket/12885#comment:14>

Django

unread,
Oct 27, 2015, 7:52:18 PM10/27/15
to django-...@googlegroups.com
#12885: GenericRelation fails to join the related table from a inherited model
-------------------------------------+-------------------------------------

Reporter: semenov | Owner: nobody
Type: Bug | Status: new
Component: | Version: 1.1
contrib.contenttypes |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/12885#comment:15>

Django

unread,
Dec 14, 2015, 11:11:37 AM12/14/15
to django-...@googlegroups.com
#12885: GenericRelation fails to join the related table from a inherited model
-------------------------------------+-------------------------------------
Reporter: semenov | Owner: nobody
Type: Bug | Status: closed
Component: | Version: 1.1
contrib.contenttypes |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"cd0ba8053dfdc81ade9a656dc8049de600638501" cd0ba805]:
{{{
#!CommitTicketReference repository=""
revision="cd0ba8053dfdc81ade9a656dc8049de600638501"
Fixed #12885 -- Fixed queries with GenericRelations to multi-table
inheritance child models.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/12885#comment:16>

Reply all
Reply to author
Forward
0 new messages