The current Datetime and Date field are very simplistic. Datetime is only compatible with ISO8601 strings in both the serialization and marshaling pipeline.
Supporting a format option in both fields would make them far more flexible. Kim should not assume everyone uses iso8601 (shame on them).
class MyMapper(Mapper):
created_at = field.DateTime() #by default is an iso8601 formatted string and validates as such
class MyMapper(Mapper):
created_at = field.DateTime(format='%Y-%m-%dT%H') # pass a custom format str
The upshot of this is that Date can simple become an extension of DateTime with a formatter that only validates the provided string is '%Y-%m-%d' for example. Users could provide custom formatters to handle special use cases IE
class DateMapper(Mapper):
year = field.Date(format='%Y')
The current Datetime and Date field are very simplistic. Datetime is only compatible with ISO8601 strings in both the serialization and marshaling pipeline.
Supporting a format option in both fields would make them far more flexible. Kim should not assume everyone uses iso8601 (shame on them).
The upshot of this is that Date can simple become an extension of DateTime with a formatter that only validates the provided string is '%Y-%m-%d' for example. Users could provide custom formatters to handle special use cases IE