How to use the sqlobject.sqlbuilder.sqlrepr function in SQLObject

To help you get started, we’ve selected a few SQLObject examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sqlobject / sqlobject / tests / test_converters.py View on Github external
def test_instance(self):
        instance = TestClass()
        self.assertEqual(sqlrepr(instance), repr(instance))
github sqlobject / sqlobject / tests / test_converters.py View on Github external
def test_op(self):
        instance = SQLOp('and', 'this', 'that')
        self.assertEqual(sqlrepr(instance), repr(instance))
github sqlobject / sqlobject / tests / test_converters.py View on Github external
def test_newstyle(self):
        instance = NewTestClass()
        self.assertEqual(sqlrepr(instance), repr(instance))
github sqlobject / sqlobject / tests / test_converters.py View on Github external
def test_bool(self):
        self.assertEqual(sqlrepr(TRUE, 'postgres'), "'t'")
        self.assertEqual(sqlrepr(FALSE, 'postgres'), "'f'")
        self.assertEqual(sqlrepr(TRUE, 'mysql'), "1")
        self.assertEqual(sqlrepr(FALSE, 'mysql'), "0")
github sqlobject / sqlobject / tests / test_converters.py View on Github external
def test_string_b(self):
        self.assertEqual(sqlrepr('A String\bAnother', 'postgres'), "'A String\\bAnother'")
github sqlobject / sqlobject / tests / test_converters.py View on Github external
def test_delete(self):
        instance = Delete('test', None)
        self.assertEqual(sqlrepr(instance), repr(instance))
github yt-project / yt / yt / deliverator / deliverator / getoptionvals.py View on Github external
def getValsCol(column):
    i = sqlbuilder.table.Image
    c = sqlbuilder.table.Image.__getattr__(column)
    rid = getRID()
    where = (i.enzorun_ID == rid)
    a = sqlbuilder.Select(c, where=where, distinct=True)
    a = model.Image._connection.queryAll(sqlbuilder.sqlrepr(a))
    a = map(str, [r[0] for r in a])
    a.sort()
    return zip(a,a)
github sqlobject / sqlobject / sqlobject / col.py View on Github external
def _postgresType(self):
        length = max(map(self._getlength, self.enumValues))
        enumValues = ', '.join(
            [sqlbuilder.sqlrepr(v, 'postgres') for v in self.enumValues])
        checkConstraint = "CHECK (%s in (%s))" % (self.dbName, enumValues)
        return "VARCHAR(%i) %s" % (length, checkConstraint)