Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from typing import Optional, List, Type, Sequence, Dict, Union, Any, Callable
- from bottle import Response
- from fastapi import FastAPI, APIRouter, params, routing
- from fastapi.datastructures import Default
- from fastapi.routing import APIRoute
- from starlette.responses import JSONResponse
- from starlette.routing import BaseRoute
- from starlette.types import ASGIApp
- app = FastAPI()
- router = APIRouter()
- class ClassBaseViewBase:
- prefix: str = ""
- tags: Optional[List[str]] = None
- dependencies: Optional[Sequence[params.Depends]] = None
- default_response_class: Type[Response] = Default(JSONResponse)
- responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None
- callbacks: Optional[List[BaseRoute]] = None
- routes: Optional[List[routing.BaseRoute]] = None
- redirect_slashes: bool = True
- default: Optional[ASGIApp] = None
- dependency_overrides_provider: Optional[Any] = None
- route_class: Type[APIRoute] = APIRoute
- on_startup: Optional[Sequence[Callable[[], Any]]] = None
- on_shutdown: Optional[Sequence[Callable[[], Any]]] = None
- deprecated: Optional[bool] = None
- include_in_schema: bool = True
- class ClassBaseViewMeta(type):
- def __new__(mcs, name, bases, attrs):
- return super().__new__(mcs, name, bases, attrs)
- class ClassBaseView(ClassBaseViewBase, metaclass=ClassBaseViewMeta):
- pass
- if __name__ == '__main__':
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement