Skip to content

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

Description

@devanubis

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions