-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow null and strings as date values
When creating or modifying Django instances, it is possible to use a string for DateField, DateTimeField, and DurationField values. Before writing to the database, these are converted to Date, DateTime, etc., but when reading the value from the new instance, it will still be a string. This code uses the Django utilities to parse strings into datetime objects before serializing them to JSON for the cache. For nullable fields, None is a possible value, and this is serialized as null for the cache.
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters