Steven Loria
Steven Loria
Let's consider this accepted for 4.0.
Should we also "auto-inherit" `Meta` even when doing single inheritance? ```python class MyBaseSchema(Schema): class Meta: render_module = ujson class ArtistSchema(MyBaseSchema): class Meta: # implicitly inherits MyBaseSchema.Meta ordered = True ```
I'm don't have a good sense whether this implicit inheritance matches user expectations. Do you have time to provide an evaluation of what other libraries do (e.g. Django ORM, wtforms,...
It would make `default` value get returned for missing values on serialization. ```python from marshmallow import Schema, fields class ArtistSchema(Schema): name = fields.Str(default="---", missing_values=("",)) sch = ArtistSchema() print(sch.dump({})) # =>...
That's a good point; the client inputs for "no data" may be different from the database's representation. `default_values` is indeed misleading. If we go with https://github.com/marshmallow-code/marshmallow/issues/778 , we could do...
For your use case, is there an issue with using `load`? I'd rather not add API surface if the common use case is met by existing API.
An interesting idea. I don't think using `inspect` is the right approach; we used to do this with `Function` and `Method` fields, but it turned out to incur significant performance...
Yes, that was what I was thinking. Although it might be better to pass the field and field name rather than just the context. That would allow you to access...
There is a proposal in #334 to allow error messages to be defined as callables that receive the input value and field object. It would also make sense to also...
DRF added this functionality--we may decide to do something similar? https://www.django-rest-framework.org/community/3.11-announcement/#validator-default-context