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
S&co approach was to store date as a DateField to take advantage of django and postgres date sorting and filtering, and store a precision object in parallel, that tracked which portions of the date were known. A descriptor was used to combine the date and precision flag into a PartialDate that took the known/unknown portions into account. We have a custom queryset filter for filtering on whether a year is known or not based on that precision flag. We created a model mixin that included start and end date (adds precision flag and partial date descriptors).
Date precision flag was never set directly, but was set based on parsing and validating the supported date formats entered into the system, and then used for serializing back out into the needed format. Preferred access was through the descriptor field that combined the date and the precision; some operations required knowing how this was set up (e.g. queryset to filter on start date but then filter to dates with known years)
resources:
The text was updated successfully, but these errors were encountered: