Add ability to set partial default in Meta class
It doesn't seem to be possible to configure a default partial property in the Meta class. Is there a reason for this?
It would be nice to be able to follow a pattern as follows:
class InsertSchema(Schema):
class Meta:
unknown = EXCLUDE
id = fields.UUID(required=False)
name = fields.Str(required=True)
description = fields.Str(required=True)
class UpdateSchema(InsertSchema):
class Meta(InsertSchema.Meta):
exclude = ["id"]
partial = True
The exclude in Meta works as expected, but the partial does not. I'm also using flask_smorest, so of course I can define this at the request level, e.g.
@blueprint.arguments(UpdateSchema(partial=True))
but it would be nice to be able to define it at the class-level, especially if the partial configuration is more complex and perhaps the schema is used in multiple places.
Also interested in this feature.
Particularly since it is not possible to use MySchema and MySchema(partial=True) without getting a naming collision with flask-sqlalchemy.
I guess partial was meant to be an instance parameter, but I see no objection to making it a class parameter.
Is someone willing to investigate and contribute the change?