-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
36 lines (28 loc) · 1000 Bytes
/
models.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
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS
class Config():
ECRET_KEY = "asdasda"
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:[email protected]:3306/webserver"
SQLALCHEMY_TRACK_MODIFICATIONS = True
MAX_CONTENT_LENGTH = 40 * 1024 * 1024
SQLALCHEMY_POOL_SIZE = 1024
SQLALCHEMY_POOL_TIMEOUT = 90
SQLALCHEMY_POOL_RECYCLE = 3
SQLALCHEMY_MAX_OVERFLOW = 1024
app = Flask(__name__)
app.config.from_object(Config)
CORS(app)
db = SQLAlchemy(app)
class Item(db.Model):
# 事项id
__tablename__ = "item_info"
id = db.Column(db.Integer, primary_key=True)
# 事项内容
content = db.Column(db.Text, nullable=False)
# 事项完成状态,已完成为1,待办为0,默认为待办
status = db.Column(db.Integer, nullable=False)
# 事项添加 时间
addtime = db.Column(db.String(255), nullable=False)
# 事项截止时间
deadline = db.Column(db.String(255), nullable=False)