New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error if the value is null and the schema expects a different thing #121
Comments
What do you think if the form should implicitly convert the data from |
That would work too, but I'm not sure if in more complex schemas or other use cases the nullable property would be better. |
You mean something like this: Only way I can think of to make it work is by allowing the user to select/toggle between the types, similar to how |
I've tried to address this in the new release v2.20.0. The form is now a bit more tolerant if it receives I've also tested it with some complex, deeply nested schemas and this seems to work well. Supporting multiple types required a rewrite of significant portion of the code which I didn't think was worth it since it's a rare use case. For now, I'll close this issue. But if you should find some cases where it doesn't work, feel free to re-open the issue. Please upgrade and test it out. Thank you. |
WIth this schema:
If the value of the field in database is
{'foo': None}
, the following happens:If you update the value only via the admin it will never be null but if you update via outside sources it could be, so maybe there's should be an option to indicate that a certain key is nullable.
The text was updated successfully, but these errors were encountered: