You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
627 B
Django/Jinja
20 lines
627 B
Django/Jinja
# -*- coding: utf-8 -*-
|
|
|
|
from app.core.base_crud import CRUDBase
|
|
from app.core.base_schema import AuthSchema
|
|
from .model import {{ class_name }}Model
|
|
from .schema import {{ class_name }}CreateSchema, {{ class_name }}UpdateSchema
|
|
|
|
|
|
class {{ class_name }}CRUD(CRUDBase[{{ class_name }}Model, {{ class_name }}CreateSchema, {{ class_name }}UpdateSchema]):
|
|
"""{{ function_name }}数据层"""
|
|
|
|
def __init__(self, auth: AuthSchema) -> None:
|
|
"""
|
|
初始化CRUD数据层
|
|
|
|
参数:
|
|
- auth (AuthSchema): 认证信息模型
|
|
"""
|
|
super().__init__(model={{ class_name }}Model, auth=auth)
|