예제 #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)")