Multi-table inheritance and primary keys

94 views
Skip to first unread message

Torsten Bronger

unread,
Dec 11, 2014, 5:01:51 AM12/11/14
to django...@googlegroups.com
Hallöchen!

Is it correct that when using multi-table inheritance, I must not
set an explicit primary key in the derived model class? Currently,
I get

...
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: column "process_ptr_id" of relation "samples_deposition" already exists

while applying the initial migration and wonder whether that what I
try to achive is possible at all.

("samples" is the app name, "deposition" is the model name of the
derived model.)

Tschö,
Torsten.

--
Torsten Bronger Jabber ID: torsten...@jabber.rwth-aachen.de
or http://bronger-jmp.appspot.com

Markus Holtermann

unread,
Dec 11, 2014, 6:51:15 AM12/11/14
to django...@googlegroups.com
Hey Torsten,

It looks like you ran into the bug reported as https://code.djangoproject.com/ticket/23956 . See my comment #6 for a workaround.

/Markus

James Schneider

unread,
Dec 11, 2014, 7:15:42 AM12/11/14
to django...@googlegroups.com

Can you provide a small example of the code? This section may also answer your question:

https://docs.djangoproject.com/en/1.7/topics/db/models/#multiple-inheritance

- James

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/87sigmfqxl.fsf%40physik.rwth-aachen.de.
For more options, visit https://groups.google.com/d/optout.

Torsten Bronger

unread,
Dec 11, 2014, 8:21:41 AM12/11/14
to django...@googlegroups.com
Hallöchen!

Markus Holtermann writes:

> It looks like you ran into the bug reported as
> https://code.djangoproject.com/ticket/23956 . See my comment #6
> for a workaround.

Thank you for the pointer, this is it indeed. I commented there.

Regards,

Markus Holtermann

unread,
Dec 11, 2014, 3:12:59 PM12/11/14
to django...@googlegroups.com
Hey folks,

Tim thankfully merged my patch and backported it to 1.7. You could check out Django's stable/1.7.x branch to see if that solves your problem.

/Markus
Reply all
Reply to author
Forward
0 new messages