-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.py
38 lines (33 loc) · 1.05 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
from db.mysqlhelper import MySqLHelper
db = MySqLHelper()
class Taste(object):
__tablename__ = 'taste'
@staticmethod
def get_all():
data = db.selectall(sql='select id,name,type from taste')
return data
class Material(object):
# 定义表名
__tablename__ = 'material'
@staticmethod
def get_all():
data = db.selectall(sql='select id,name,type,category,parent,category_name,parent_name,parent_code,category_code from material')
return data
class Technics(object):
__tablename__ = 'technics'
@staticmethod
def get_all():
data = db.selectall(sql='select id,name,type from technics')
return data
class Foods(object):
__tablename__ = 'foods'
@staticmethod
def get_all():
data = db.selectall(sql='select id,name,type,category,parent from foods')
return data
class WordType(object):
__tablename__ = 'type'
@staticmethod
def get_all():
data = db.selectall(sql='select id,name,status,create_time,update_time from type')
return data