cast name to string

This commit is contained in:
Timothy Laurent 2016-11-10 00:19:35 -08:00
parent 6801b69ce9
commit aa6be2c527

View File

@ -27,7 +27,7 @@ def construct_fields(options):
is_already_created = name in options.fields
is_excluded = name in exclude_fields or is_already_created
# https://docs.djangoproject.com/en/1.10/ref/models/fields/#django.db.models.ForeignKey.related_query_name
is_no_backref = str.endswith(name, '+')
is_no_backref = str.endswith(str(name), '+')
if is_not_in_only or is_excluded or is_no_backref:
# We skip this field if we specify only_fields and is not
# in there. Or when we exclude this field in exclude_fields.