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
parent 83e434a2c2
commit b065aeb17f
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)