Coverage for tortoise_serializer/types.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-04-17 19:39 +0200

1from typing import Any, Type, TypeVar 

2 

3from frozendict import frozendict 

4from tortoise import Model 

5 

6MODEL = TypeVar("MODEL", bound=Model) 

7T = TypeVar("T") 

8ContextType = frozendict[str, Any] 

9 

10 

11class Unset: 

12 """ 

13 Describe an unset field. This field will be omitted from the Pydantic model validation when 

14 instantiating the model. 

15 

16 They are intented to be used in resolvers for `Serializer` to not set anything 

17 and be able to use `exclude_unset=True` 

18 """ 

19 

20 

21UnsetType = Type[Unset]