jazzband / jsonmodels

jsonmodels is library to make it easier for you to deal with structures that are converted to, or read from JSON.
http://jsonmodels.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
334 stars 51 forks source link

Handle None values in parse_value for Time and Date Fields #82

Closed omeranson closed 7 years ago

omeranson commented 7 years ago

Have parse_value return None when the passed value is None. This allows DateField and TimeField to return None rather than fail with a TypeError when the original value is None (or non-existant). This can happen when e.g. serializing an object where the Date (or Time) Field is optional (required=False).

beregond commented 7 years ago

Thanks for patch! Your code (+ extra) was merged in #85

beregond commented 6 years ago

released in 2.2