Commit 1ecbeebb by Mariusz Felisiak Committed by Tom Christie

Fixed #4574 -- Removed multi-table inheritance auto created PK from serialize. (#4852)

parent 21166a3a
......@@ -76,7 +76,12 @@ def _get_forward_relationships(opts):
Returns an `OrderedDict` of field names to `RelationInfo`.
"""
forward_relations = OrderedDict()
for field in [field for field in opts.fields if field.serialize and get_remote_field(field)]:
for field in [
field for field in opts.fields
if field.serialize and get_remote_field(field) and not (field.primary_key and field.one_to_one)
# If the field is a OneToOneField and it's been marked as PK, then this
# is a multi-table inheritance auto created PK ('%_ptr').
]:
forward_relations[field.name] = RelationInfo(
model_field=field,
related_model=get_related_model(field),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment