@@ -384,9 +384,9 @@ class Meta(Schema.Opts):
384
384
.. versionchanged:: 3.26.0 Deprecate `ordered`. Field order is preserved by default.
385
385
"""
386
386
387
- fields : typing .ClassVar [tuple [Field ] | list [Field ]]
387
+ fields : typing .ClassVar [tuple [str , ... ] | list [str ]]
388
388
"""Fields to include in the (de)serialized result"""
389
- additional : typing .ClassVar [tuple [Field ] | list [Field ]]
389
+ additional : typing .ClassVar [tuple [str , ... ] | list [str ]]
390
390
"""Fields to include in addition to the explicitly declared fields.
391
391
`additional <marshmallow.Schema.Meta.additional>` and `fields <marshmallow.Schema.Meta.fields>`
392
392
are mutually-exclusive options.
@@ -396,7 +396,7 @@ class Meta(Schema.Opts):
396
396
usually better to define fields as class variables, but you may need to
397
397
use this option, e.g., if your fields are Python keywords.
398
398
"""
399
- exclude : typing .ClassVar [tuple [Field ] | list [Field ]]
399
+ exclude : typing .ClassVar [tuple [str , ... ] | list [str ]]
400
400
"""Fields to exclude in the serialized result.
401
401
Nested fields can be represented with dot delimiters.
402
402
"""
@@ -408,17 +408,20 @@ class Meta(Schema.Opts):
408
408
"""Default format for `DateTime <marshmallow.fields.DateTime>` fields."""
409
409
timeformat : typing .ClassVar [str ]
410
410
"""Default format for `Time <marshmallow.fields.Time>` fields."""
411
- render_module : typing .ClassVar [types .RenderModule ]
411
+
412
+ # FIXME: Use a more constrained type here.
413
+ # ClassVar[RenderModule] doesn't work.
414
+ render_module : typing .Any
412
415
""" Module to use for `loads <marshmallow.Schema.loads>` and `dumps <marshmallow.Schema.dumps>`.
413
416
Defaults to `json` from the standard library.
414
417
"""
415
418
ordered : typing .ClassVar [bool ]
416
419
"""If `True`, `Schema.dump <marshmallow.Schema.dump>` is a `collections.OrderedDict`."""
417
420
index_errors : typing .ClassVar [bool ]
418
421
"""If `True`, errors dictionaries will include the index of invalid items in a collection."""
419
- load_only : typing .ClassVar [tuple [Field ] | list [Field ]]
422
+ load_only : typing .ClassVar [tuple [str , ... ] | list [str ]]
420
423
"""Fields to exclude from serialized results"""
421
- dump_only : typing .ClassVar [tuple [Field ] | list [Field ]]
424
+ dump_only : typing .ClassVar [tuple [str , ... ] | list [str ]]
422
425
"""Fields to exclude from serialized results"""
423
426
unknown : typing .ClassVar [str ]
424
427
"""Whether to exclude, include, or raise an error for unknown fields in the data.
0 commit comments