示例#1
0
文件: horrorm.py 项目: akrito/horrorm
 def __init__(self, *args, **kwargs):
     self.con = connect(*args, **kwargs)
     for table in self.con.tables():
         # Better than overriding __getattr__(), because we get tab completion
         setattr(self, table[0], T(self.con, table[0]))
示例#2
0
文件: tests.py 项目: akrito/cursors
 def setUp(self):
     self.c = connect(database='postgres', engine='postgres')
示例#3
0
文件: tests.py 项目: akrito/cursors
def check_connection_rule(args, kwargs, engine):
    c = connect(*args, **kwargs)
    if engine == 'sqlite':
        assert_true(isinstance(c, SQLiteConnection))
    else:
        assert_true(isinstance(c, PostgresqlConnection))
示例#4
0
文件: tests.py 项目: akrito/cursors
 def setUp(self):
     self.c = connect(database=':memory:', engine='sqlite')
     self.c("CREATE TABLE people (id, name)")
     self.c("CREATE TABLE books (id, author, title)")