`is_multiple` vs custom fields
See original GitHub issueRight now I don’t get multiple values in a custom field that does not inherit from the List
field because is_multiple
only checks for this.
And for some cases rewriting the field to be nested in an actual List field is not feasible, for example a SQLAlchemyModelList
-like field where sending individual queries would be inefficient compared to one query with an SQL IN
filter.
I propose adding a MultiValueField
which would simply inherit from Field and do nothing itself, and instead of checking for isinstance List check for that one in is_multiple
. List
would then of course inherit from that instead of Field
.
Alternatively, check for something like isinstance(field, List) or getattr(field, 'is_multiple', False)
.
I can send a PR if there’s interest in this.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
I did a few CHANGELOG updates. I don’t think it was worth a PR so I pushed to dev.
Also we might want to add a paragraph in the upgrading section of the docs.
https://webargs.readthedocs.io/en/latest/upgrading.html