Flake8 fixes

This commit is contained in:
Adam Charnock 2015-12-05 09:03:19 +00:00
parent eb665d569d
commit bfd43bc995
2 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,5 @@
try: try:
import django_filters import django_filters # noqa
except: except:
raise Exception( raise Exception(
"Use of django filtering requires the django-filter package " "Use of django filtering requires the django-filter package "

View File

@ -29,9 +29,12 @@ class DjangoObjectTypeMeta(ObjectTypeMeta):
# We skip this field if we specify only_fields and is not # We skip this field if we specify only_fields and is not
# in there. Or when we exclude this field in exclude_fields # in there. Or when we exclude this field in exclude_fields
continue continue
converted_field = convert_django_field(field) converted_field = cls.convert_django_field(field)
cls.add_to_class(field.name, converted_field) cls.add_to_class(field.name, converted_field)
def convert_django_field(cls, field):
return convert_django_field(field)
def construct(cls, *args, **kwargs): def construct(cls, *args, **kwargs):
cls = super(DjangoObjectTypeMeta, cls).construct(*args, **kwargs) cls = super(DjangoObjectTypeMeta, cls).construct(*args, **kwargs)
if not cls._meta.abstract: if not cls._meta.abstract: