Example #1
0
 def __str__(self):
     value = self.value
     if value is True:
         expr_str = 'true'
     elif value is False:
         expr_str = 'false'
     elif value is None:
         expr_str = 'null'
     elif isinstance(value, (datetime, date)):
         expr_str = utils.escape(value.strftime('%Y/%m/%d %H:%M:%S.%f'))
     else:
         expr_str = utils.escape(utils.to_text(value))
     # TODO: Geo point, Array
     return expr_str
Example #2
0
 def __str__(self):
     expr_str = utils.to_text(getattr(self.value, 'lvalue', self.value))
     return utils.escape(expr_str)
Example #3
0
 def __str__(self):
     return utils.to_text('select --table %s %s' % (
         self._table.__tablename__,
         self._condition())).strip()
Example #4
0
 def __str__(self):
     return utils.to_text(getattr(self.value, 'lvalue', self.value))
Example #5
0
def test_to_text(value, expected):
    assert utils.to_text(value) == expected