Merge pull request #619 from dsanders11/patch-1

Drop old Django compatibility code
This commit is contained in:
Mel van Londen 2019-04-27 09:10:51 -07:00 committed by GitHub
commit 6145197f44
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:
continue
# Django =>1.9 uses 'rel', django <1.9 uses 'related'
related = getattr(attr, "rel", None) or getattr(attr, "related", None)
related = getattr(attr, "rel", None)
if isinstance(related, models.ManyToOneRel):
yield (name, related)
elif isinstance(related, models.ManyToManyRel) and not related.symmetrical: