1
1
from __future__ import annotations
2
2
3
+ from typing import ClassVar , Dict
4
+
3
5
from fastapi import Depends , Header
4
6
from pydantic import BaseModel
5
7
from sqlalchemy .engine import make_url
@@ -52,7 +54,7 @@ class Config:
52
54
arbitrary_types_allowed = True
53
55
54
56
55
- async def common_handler (view : ViewBase , dto : BaseModel ) -> dict :
57
+ async def common_handler (view : ViewBase , dto : SessionDependency ) -> dict :
56
58
return {"session" : dto .session }
57
59
58
60
@@ -66,7 +68,7 @@ class AdminOnlyPermission(BaseModel):
66
68
67
69
68
70
class DetailView (DetailViewBaseGeneric ):
69
- method_dependencies : dict [ HTTPMethod , HTTPMethodConfig ] = {
71
+ method_dependencies : ClassVar [ Dict [ HTTPMethod , HTTPMethodConfig ] ] = {
70
72
HTTPMethod .ALL : HTTPMethodConfig (
71
73
dependencies = SessionDependency ,
72
74
prepare_data_layer_kwargs = common_handler ,
@@ -75,7 +77,7 @@ class DetailView(DetailViewBaseGeneric):
75
77
76
78
77
79
class ListView (ListViewBaseGeneric ):
78
- method_dependencies : dict [ HTTPMethod , HTTPMethodConfig ] = {
80
+ method_dependencies : ClassVar [ Dict [ HTTPMethod , HTTPMethodConfig ] ] = {
79
81
HTTPMethod .GET : HTTPMethodConfig (dependencies = AdminOnlyPermission ),
80
82
HTTPMethod .ALL : HTTPMethodConfig (
81
83
dependencies = SessionDependency ,
0 commit comments