def to_python(self, value): value = super(TimeZoneField, self).to_python(value) if value is None: return None # null=True return coerce_timezone_value(value)
def from_db_value(self, value, expression, connection): if value is None: return None return coerce_timezone_value(value)
def from_db_value(self, value, expression, connection, context): value = super(TimeZoneField, self).to_python(value) if value is None: return None # null=True return coerce_timezone_value(value)