def convert_value(self, value, expression, connection, context): if value is None: return None d = DistanceMeasure() d.standard = value return d