11from __future__ import annotations
22
3+ from typing import ClassVar , Dict
4+
35from fastapi import Depends , Header
46from pydantic import BaseModel
57from sqlalchemy .engine import make_url
@@ -52,7 +54,7 @@ class Config:
5254 arbitrary_types_allowed = True
5355
5456
55- async def common_handler (view : ViewBase , dto : BaseModel ) -> dict :
57+ async def common_handler (view : ViewBase , dto : SessionDependency ) -> dict :
5658 return {"session" : dto .session }
5759
5860
@@ -66,7 +68,7 @@ class AdminOnlyPermission(BaseModel):
6668
6769
6870class DetailView (DetailViewBaseGeneric ):
69- method_dependencies : dict [ HTTPMethod , HTTPMethodConfig ] = {
71+ method_dependencies : ClassVar [ Dict [ HTTPMethod , HTTPMethodConfig ] ] = {
7072 HTTPMethod .ALL : HTTPMethodConfig (
7173 dependencies = SessionDependency ,
7274 prepare_data_layer_kwargs = common_handler ,
@@ -75,7 +77,7 @@ class DetailView(DetailViewBaseGeneric):
7577
7678
7779class ListView (ListViewBaseGeneric ):
78- method_dependencies : dict [ HTTPMethod , HTTPMethodConfig ] = {
80+ method_dependencies : ClassVar [ Dict [ HTTPMethod , HTTPMethodConfig ] ] = {
7981 HTTPMethod .GET : HTTPMethodConfig (dependencies = AdminOnlyPermission ),
8082 HTTPMethod .ALL : HTTPMethodConfig (
8183 dependencies = SessionDependency ,
0 commit comments