mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +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:
parent
83e434a2c2
commit
b065aeb17f
3 changed files with 36 additions and 24 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue