def _date_to_json ( value ) : if isinstance ( value , datetime . date ) : value = value . isoformat ( ) return value
json python isoformat datetime
Coerce value to an JSON - compatible representation .
def _date_to_json(value):
    """Coerce 'value' to an JSON-compatible representation."""
    if isinstance(value, datetime.date):
        value = value.isoformat()
    return value