def __unicode__(self): value = self.value if isinstance(value, timedelta): if value.microseconds: return "INTERVAL '%s' HOUR_MICROSECOND" % timedelta2str(value) return "INTERVAL '%s' HOUR_SECOND" % timedelta2str(value) return Value.__unicode__(self)
def __unicode__(self): value = self.value if isinstance(value, datetime): return self.quote_str(datetime2timestamp(value)) if isinstance(value, date): return self.quote_str(str(value)) if isinstance(value, timedelta): return repr(value.total_seconds() / (24 * 60 * 60)) return Value.__unicode__(self)
def __unicode__(self): value = self.value if isinstance(value, bool): return value and 'true' or 'false' return Value.__unicode__(self)
def quote_str(self, s): s = s.replace('%', '%%') return Value.quote_str(self, s)