Drop old Django compatibility code

This commit is contained in:
David Sanders 2019-04-15 05:53:30 -07:00 committed by GitHub
parent 090ce6e1f1
commit 6acd917cf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,8 +25,7 @@ def get_reverse_fields(model, local_field_names):
if name in local_field_names: if name in local_field_names:
continue continue
# Django =>1.9 uses 'rel', django <1.9 uses 'related' related = getattr(attr, "rel", None)
related = getattr(attr, "rel", None) or getattr(attr, "related", None)
if isinstance(related, models.ManyToOneRel): if isinstance(related, models.ManyToOneRel):
yield (name, related) yield (name, related)
elif isinstance(related, models.ManyToManyRel) and not related.symmetrical: elif isinstance(related, models.ManyToManyRel) and not related.symmetrical: