Skip to content
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

Option to allow empty ranges to be represented as None/null #208

Open
devanubis opened this issue Apr 18, 2024 · 0 comments
Open

Option to allow empty ranges to be represented as None/null #208

devanubis opened this issue Apr 18, 2024 · 0 comments

Comments

@devanubis
Copy link

Hi, would you accept a PR to add an option represent_empty_as_null to RangeField so that to_representation() returns None when value.isempty

Our main use-case for this is that it would be a bit simpler for consumers of our API to just handle a null value for an absent/empty range, rather than having to process {"empty": true} 

We don't need to be able to serialise incoming null into an empty Range, but if you think that might be consistent/useful then we could add it at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant