25
25
26
26
class ORMField (OrderedType ):
27
27
def __init__ (
28
- self ,
29
- model_attr = None ,
30
- type_ = None ,
31
- required = None ,
32
- description = None ,
33
- deprecation_reason = None ,
34
- batching = None ,
35
- _creation_counter = None ,
36
- ** field_kwargs
28
+ self ,
29
+ model_attr = None ,
30
+ type_ = None ,
31
+ required = None ,
32
+ description = None ,
33
+ deprecation_reason = None ,
34
+ batching = None ,
35
+ _creation_counter = None ,
36
+ ** field_kwargs
37
37
):
38
38
"""
39
39
Use this to override fields automatically generated by SQLAlchemyObjectType.
@@ -89,7 +89,7 @@ class Meta:
89
89
90
90
91
91
def construct_fields (
92
- obj_type , model , registry , only_fields , exclude_fields , batching , connection_field_factory
92
+ obj_type , model , registry , only_fields , exclude_fields , batching , connection_field_factory
93
93
):
94
94
"""
95
95
Construct all the fields for a SQLAlchemyObjectType.
@@ -110,11 +110,11 @@ def construct_fields(
110
110
inspected_model = sqlalchemy .inspect (model )
111
111
# Gather all the relevant attributes from the SQLAlchemy model in order
112
112
all_model_attrs = OrderedDict (
113
- inspected_model .column_attrs .items () +
114
- inspected_model .composites .items () +
115
- [(name , item ) for name , item in inspected_model .all_orm_descriptors .items ()
116
- if isinstance (item , hybrid_property )] +
117
- inspected_model .relationships .items ()
113
+ inspected_model .column_attrs .items ()
114
+ + inspected_model .composites .items ()
115
+ + [(name , item ) for name , item in inspected_model .all_orm_descriptors .items ()
116
+ if isinstance (item , hybrid_property )]
117
+ + inspected_model .relationships .items ()
118
118
)
119
119
120
120
# Filter out excluded fields
@@ -191,21 +191,21 @@ class SQLAlchemyObjectTypeOptions(ObjectTypeOptions):
191
191
class SQLAlchemyObjectType (ObjectType ):
192
192
@classmethod
193
193
def __init_subclass_with_meta__ (
194
- cls ,
195
- model = None ,
196
- registry = None ,
197
- skip_registry = False ,
198
- only_fields = (),
199
- exclude_fields = (),
200
- connection = None ,
201
- connection_class = None ,
202
- use_connection = None ,
203
- interfaces = (),
204
- id = None ,
205
- batching = False ,
206
- connection_field_factory = None ,
207
- _meta = None ,
208
- ** options
194
+ cls ,
195
+ model = None ,
196
+ registry = None ,
197
+ skip_registry = False ,
198
+ only_fields = (),
199
+ exclude_fields = (),
200
+ connection = None ,
201
+ connection_class = None ,
202
+ use_connection = None ,
203
+ interfaces = (),
204
+ id = None ,
205
+ batching = False ,
206
+ connection_field_factory = None ,
207
+ _meta = None ,
208
+ ** options
209
209
):
210
210
# Make sure model is a valid SQLAlchemy model
211
211
if not is_mapped_class (model ):
0 commit comments