File tree Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 11import logging
2- from typing import Any , Tuple
2+ from typing import Any , Tuple , Type
33
44from django .db import models
55from django .db .models .query import QuerySet
1212
1313
1414class CrudModel (object ):
15- def __init__ (self , model : models .Model ):
15+ def __init__ (self , model : Type [ models .Model ] ):
1616 self .model = model
1717
1818 def __get_fields (self , payload : dict ) -> Tuple [dict , dict ]:
Original file line number Diff line number Diff line change 11import logging
2- from typing import Optional , Type
2+ from typing import Type
33
44from django .db import models
55
6- from easy .domain import BaseDomain
76from easy .services .crud import CrudService
87from easy .services .permission import PermissionService
98
1312class BaseService (CrudService , PermissionService ):
1413 def __init__ (
1514 self ,
16- model : models .Model ,
17- biz : Optional [Type [BaseDomain ]] = None ,
15+ model : Type [models .Model ],
1816 ):
19- self .biz = biz
20- if self .biz :
21- self .model = self .biz .model
22- else :
23- self .model = model
17+ self .model = model
2418 super ().__init__ (model = self .model )
Original file line number Diff line number Diff line change 11import logging
2- from typing import Any
2+ from typing import Any , Type
33
44from asgiref .sync import sync_to_async
55from django .db import models
1010
1111
1212class CrudService (CrudModel ):
13- def __init__ (self , model : models .Model ):
13+ def __init__ (self , model : Type [ models .Model ] ):
1414 super ().__init__ (model )
1515 self .model = model
1616
You can’t perform that action at this time.
0 commit comments