generated from Blog/Python-Flask-Template
feat: add Models+Schema and User Controller
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema
|
||||
from Models.User import User
|
||||
from Models.Post import Post
|
||||
from Models.Tag import Tag
|
||||
from Models.Ticket import Ticket
|
||||
from Models.Task import Task
|
||||
from Models.IoC import IoC
|
||||
from Models.Tenant import Tenant
|
||||
from Models.Role import Role
|
||||
from Models.Permission import Permission
|
||||
|
||||
class UserSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
@@ -11,23 +15,59 @@ class UserSchema(SQLAlchemyAutoSchema):
|
||||
include_relationships = True
|
||||
load_instance = True
|
||||
|
||||
class PostSchema(SQLAlchemyAutoSchema):
|
||||
class TicketSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model= Post
|
||||
model= Ticket
|
||||
include_fk = True
|
||||
include_relationships = True
|
||||
load_instance = True
|
||||
|
||||
class TagSchema(SQLAlchemyAutoSchema):
|
||||
class TaskSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model= Tag
|
||||
model= Task
|
||||
include_fk = True
|
||||
include_relationships = True
|
||||
load_instance = True
|
||||
|
||||
class IoCSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model= IoC
|
||||
include_fk = True
|
||||
include_relationships = True
|
||||
load_instance = True
|
||||
|
||||
class TenantSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model= Tenant
|
||||
include_fk = True
|
||||
include_relationships = True
|
||||
load_instance = True
|
||||
|
||||
class RoleSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model= Role
|
||||
include_fk = True
|
||||
include_relationships = True
|
||||
load_instance = True
|
||||
|
||||
class PermissionSchema(SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model= Permission
|
||||
include_fk = True
|
||||
include_relationships = True
|
||||
load_instance = True
|
||||
|
||||
user_schema = UserSchema()
|
||||
users_schema = UserSchema(many=True)
|
||||
post_schema = PostSchema()
|
||||
posts_schema = PostSchema(many=True)
|
||||
tag_schema = TagSchema()
|
||||
tags_schema = TagSchema(many=True)
|
||||
ticket_schema = TicketSchema()
|
||||
tickets_schema = TicketSchema(many=True)
|
||||
task_schema = TaskSchema()
|
||||
tasks_schema = TaskSchema(many=True)
|
||||
ioc_schema = IoCSchema()
|
||||
iocs_schema = IoCSchema(many=True)
|
||||
tenant_schema = TenantSchema()
|
||||
tenants_schema = TenantSchema(many=True)
|
||||
role_schema = RoleSchema()
|
||||
roles_schema = RoleSchema(many=True)
|
||||
permission_schema = PermissionSchema()
|
||||
permissions_schema = PermissionSchema(many=True)
|
Reference in New Issue
Block a user