Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@for_type("date")
def _date(self, value):
if isinstance(value, datetime):
return value.date()
(y, m, d) = map(int, str(value)[:10].strip().split("-"))
return date(y, m, d)
@for_type('boolean')
def _boolean(self, value):
return value
@for_type("reference")
def _reference(self, value, referee):
if "." not in referee:
value = Reference(value)
value._table, value._record = self.adapter.db[referee], None
return value
@for_type('date')
def _date(self, value):
if not isinstance(value, date):
return DateParser._declared_parsers_['_date'].f(self, value)
return value
@for_type("integer")
def _integer(self, value):
return int(value)
@for_type('datetime')
def _datetime(self, value):
if not isinstance(value, datetime):
return DateTimeParser._declared_parsers_['_datetime'].f(
self, value)
return value
@for_type("integer")
def _integer(self, value):
return long(value)
@for_type("list:integer")
def _list_integers(self, value):
return bar_decode_integer(value)
@for_type('jsonb')
def _jsonb(self, value):
return self.json(value)
@for_type("decimal")
def _decimal(self, value):
return Decimal(value)