mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-23 15:10:48 +03:00
fixed model column name
This commit is contained in:
parent
1711e6a529
commit
67fe978f2d
|
@ -33,16 +33,16 @@ class SQLAlchemyObjectTypeMeta(ObjectTypeMeta):
|
|||
converted_relationship = convert_sqlalchemy_relationship(relationship)
|
||||
cls.add_to_class(relationship.key, converted_relationship)
|
||||
|
||||
for column in inspected_model.columns:
|
||||
is_not_in_only = only_fields and column.name not in only_fields
|
||||
is_already_created = column.name in already_created_fields
|
||||
is_excluded = column.name in exclude_fields or is_already_created
|
||||
for name, column in inspected_model.columns.items():
|
||||
is_not_in_only = only_fields and name not in only_fields
|
||||
is_already_created = name in already_created_fields
|
||||
is_excluded = name in exclude_fields or is_already_created
|
||||
if is_not_in_only or is_excluded:
|
||||
# We skip this field if we specify only_fields and is not
|
||||
# in there. Or when we excldue this field in exclude_fields
|
||||
continue
|
||||
converted_column = convert_sqlalchemy_column(column)
|
||||
cls.add_to_class(column.name, converted_column)
|
||||
cls.add_to_class(name, converted_column)
|
||||
|
||||
def construct(cls, *args, **kwargs):
|
||||
cls = super(SQLAlchemyObjectTypeMeta, cls).construct(*args, **kwargs)
|
||||
|
|
Loading…
Reference in New Issue
Block a user