You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why can't you ignore the key if it has an empty value?
I think I can add a keyword called skip_if_empty which will omit the key from the final data, but I'd like to know some use-cases and reasons for this feature.
It's mostly about not having to store data that isn't needed, and that the admin is not the only source of inputs, so now we would have to replicate the behavior of the library also in other places if we want to keep everything standardized.
The workaround isn't hard (just deleting keys with empty values in an extended model field), so you can close the issue if you don't think it's a good feature.
We have a field that is like this:
Outside of the admin, we set the timestamps only when they are needed.
So for example this could be a valid value for us:
However, once you edit the model from the admin, that value is set to:
Would it be possible to add a keyword to the schema key that makes so the key isn't stored unless it has a non falsy value?
The text was updated successfully, but these errors were encountered: