@@ -85,6 +85,7 @@ class Meta:
85
85
# Composite
86
86
"composite_prop" ,
87
87
# Hybrid
88
+ "hybrid_prop_with_doc" ,
88
89
"hybrid_prop" ,
89
90
"hybrid_prop_str" ,
90
91
"hybrid_prop_int" ,
@@ -150,6 +151,12 @@ class Meta:
150
151
# "doc" is ignored by hybrid_property
151
152
assert hybrid_prop_list .description is None
152
153
154
+ # hybrid_prop_with_doc
155
+ hybrid_prop_with_doc = ReporterType ._meta .fields ['hybrid_prop_with_doc' ]
156
+ assert hybrid_prop_with_doc .type == String
157
+ # docstring is picked up from hybrid_prop_with_doc
158
+ assert hybrid_prop_with_doc .description == "Docstring test"
159
+
153
160
# relationship
154
161
favorite_article_field = ReporterType ._meta .fields ['favorite_article' ]
155
162
assert isinstance (favorite_article_field , Dynamic )
@@ -183,6 +190,7 @@ class Meta:
183
190
composite_prop = ORMField ()
184
191
185
192
# hybrid_property
193
+ hybrid_prop_with_doc = ORMField (description = 'Overridden' )
186
194
hybrid_prop = ORMField (description = 'Overridden' )
187
195
188
196
# relationships
@@ -210,6 +218,7 @@ class Meta:
210
218
"email_v2" ,
211
219
"column_prop" ,
212
220
"composite_prop" ,
221
+ "hybrid_prop_with_doc" ,
213
222
"hybrid_prop" ,
214
223
"favorite_article" ,
215
224
"articles" ,
@@ -250,6 +259,11 @@ class Meta:
250
259
assert hybrid_prop_field .description == "Overridden"
251
260
assert hybrid_prop_field .deprecation_reason is None
252
261
262
+ hybrid_prop_with_doc_field = ReporterType ._meta .fields ['hybrid_prop_with_doc' ]
263
+ assert hybrid_prop_with_doc_field .type == String
264
+ assert hybrid_prop_with_doc_field .description == "Overridden"
265
+ assert hybrid_prop_with_doc_field .deprecation_reason is None
266
+
253
267
column_prop_field_v2 = ReporterType ._meta .fields ['column_prop' ]
254
268
assert column_prop_field_v2 .type == String
255
269
assert column_prop_field_v2 .description is None
@@ -318,6 +332,7 @@ class Meta:
318
332
"email" ,
319
333
"favorite_pet_kind" ,
320
334
"composite_prop" ,
335
+ "hybrid_prop_with_doc" ,
321
336
"hybrid_prop" ,
322
337
"hybrid_prop_str" ,
323
338
"hybrid_prop_int" ,
@@ -432,7 +447,7 @@ class Meta:
432
447
433
448
assert issubclass (CustomReporterType , ObjectType )
434
449
assert CustomReporterType ._meta .model == Reporter
435
- assert len (CustomReporterType ._meta .fields ) == 16
450
+ assert len (CustomReporterType ._meta .fields ) == 17
436
451
437
452
438
453
# Test Custom SQLAlchemyObjectType with Custom Options
0 commit comments