from flask import render_template
from common.utils.rights import permission_required, view_logging_required
from . import index_bp
# dqc表增加
@index_bp.get('/dqc/tb_info')
@view_logging_required
@permission_required("dqc:tb_info")
def dqc_tb_info():
return render_template('admin/dqc/tb_info/tbs_info.html')
__init__.py
进行注册from . import dqc_tb_info
3. 项目目录下运行 flask routes 查看所有路由情况,看路由是否生效
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Titletitle>
head>
<body>
内容在里面写
body>
html>
from datetime import datetime
from extensions import db
class DqcTbInfoModel(db.Model):
__tablename__ = 'dqc_tb_info'
id = db.Column(db.String(64), primary_key=True, nullable=False, comment="表ID")
module_id = db.Column(db.Integer, default=0, comment="模块id")
db_type = db.Column(db.String(32), comment="库名称")
db_name = db.Column(db.String(32), comment="表所属模块")
tb_name = db.Column(db.String(64), comment="表名")
primary_keys = db.Column(db.String(128), comment="表主键")
create_time = db.Column(db.DateTime, default=datetime.now, comment='创建时间')
update_time = db.Column(db.DateTime, default=datetime.now, comment='更新时间')
__init__.py
进行注册from .file import PhotoModel
from .rights import RightModel, RoleModel
from .system import LogModel
from .users import UserModel, DepartmentModel
from .dqc import DqcTbInfoModel