forked from t1mt/tornado-cms-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.py
71 lines (39 loc) · 1.1 KB
/
model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python
#coding:utf-8
import sqlite3
class Connection(object):
"""docstring for Connetion"""
def __init__(self, arg):
super(Connetion, self).__init__()
self.arg = arg
class DB(object):
"""数据库操作对象基类DB"""
def __del__(self, sql):
raise NotImplementedError()
def cursor(self):
raise NotImplementedError()
def close(self):
raise NotImplementedError()
def reconnect(self):
raise NotImplementedError()
def iter(self, query, *parameters):
raise NotImplementedError()
def get(self):
raise NotImplementedError()
def query(self, query, *parameters):
raise NotImplementedError()
def execute(self, query, *parameters):
raise NotImplementedError()
def executemany(self, query, parameters):
raise NotImplementedError()
def _ensure_connected(self):
raise NotImplementedError()
def _cursor(self):
raise NotImplementedError()
def _execute(self, cursor, query, parameters):
raise NotImplementedError()
class SqliteImpl(DB):
"""docstring for SqliteImpl"""
def __init__(self, arg):
super(Sqlite, self).__init__()
self.arg = arg