分解models

This commit is contained in:
mkg
2021-04-27 11:58:21 +08:00
parent 3ea4edd117
commit 8f4054e576
30 changed files with 343 additions and 154 deletions
+3 -6
View File
@@ -1,10 +1,10 @@
from flask import jsonify
from flask_marshmallow import Marshmallow
from marshmallow import fields
from sqlalchemy import and_
from applications.models import db
from applications.models.admin import Role, Power, User
from applications.models.admin_role import Role
from applications.models.admin_power import Power
from applications.models.admin_user import User
ma = Marshmallow()
@@ -147,8 +147,6 @@ def disable_status(id):
return False
# 删除角色
def remove_role(id):
role = Role.query.filter_by(id=id).first()
@@ -177,4 +175,3 @@ def batch_remove(ids):
# db.session.commit()
for id in ids:
remove_role(id)