better endswith

This commit is contained in:
Timothy Laurent 2016-11-10 10:16:44 -08:00
parent aa6be2c527
commit 1fdd7756ec

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(str(name), '+')
is_no_backref = str(name).endswith('+')
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.