1
0
mirror of https://github.com/django/django.git synced 2025-10-27 15:46:10 +00:00

Fixed #20946 -- model inheritance + m2m failure

Cleaned up the internal implementation of m2m fields by removing
related.py _get_fk_val(). The _get_fk_val() was doing the wrong thing
if asked for the foreign key value on foreign key to parent model's
primary key when child model had different primary key field.
This commit is contained in:
Anssi Kääriäinen
2013-08-20 17:13:41 +03:00
committed by Andrew Godwin
parent 7775ced938
commit 244e2b71f5
3 changed files with 36 additions and 24 deletions

View File

@@ -162,3 +162,9 @@ class Mixin(object):
class MixinModel(models.Model, Mixin):
pass
class Base(models.Model):
titles = models.ManyToManyField(Title)
class SubBase(Base):
sub_id = models.IntegerField(primary_key=True)