wip(semantic):数据模型语义化
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import datetime
|
||||
|
||||
from applications.extensions import db
|
||||
from ..base import BaseModel
|
||||
|
||||
|
||||
class Power(db.Model):
|
||||
class RightsPower(db.Model, BaseModel):
|
||||
__tablename__ = 'rt_power'
|
||||
id = db.Column(db.Integer, primary_key=True, comment='权限编号')
|
||||
name = db.Column(db.String(255), comment='权限名称')
|
||||
@@ -14,7 +16,8 @@ class Power(db.Model):
|
||||
icon = db.Column(db.String(128), comment='图标')
|
||||
sort = db.Column(db.Integer, comment='排序')
|
||||
create_time = db.Column(db.DateTime, default=datetime.datetime.now, comment='创建时间')
|
||||
|
||||
update_time = db.Column(db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now, comment='更新时间')
|
||||
enable = db.Column(db.Integer, comment='是否开启')
|
||||
|
||||
parent = db.relationship("Power", remote_side=[id]) # 自关联
|
||||
parent = db.relationship("RightsPower", remote_side=[id]) # 自关联
|
||||
|
||||
Reference in New Issue
Block a user