-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
test_sync[bases.py].raw
199 lines (137 loc) · 6.29 KB
/
test_sync[bases.py].raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
'''
# -*- coding: utf-8 -*-
# code generated by Prisma. DO NOT EDIT.
# pyright: reportUnusedImport=false
# fmt: off
# global imports for type checking
from builtins import bool as _bool
from builtins import int as _int
from builtins import float as _float
from builtins import str as _str
import sys
import decimal
import datetime
from typing import (
TYPE_CHECKING,
Optional,
Iterable,
Iterator,
Sequence,
Callable,
ClassVar,
NoReturn,
TypeVar,
Generic,
Mapping,
Tuple,
Union,
List,
Dict,
Type,
Any,
Set,
overload,
cast,
)
from typing_extensions import TypedDict, Literal
LiteralString = str
# -- template models.py.jinja --
from pydantic import BaseModel
from . import fields, actions
from ._types import FuncType
from .builder import serialize_base64
from ._compat import PYDANTIC_V2, ConfigDict
if TYPE_CHECKING:
from .client import Prisma
_PrismaModelT = TypeVar('_PrismaModelT', bound='_PrismaModel')
class _PrismaModel(BaseModel):
if PYDANTIC_V2:
model_config: ClassVar[ConfigDict] = ConfigDict(
use_enum_values=True,
arbitrary_types_allowed=True,
populate_by_name=True,
)
elif not TYPE_CHECKING:
from ._compat import BaseConfig
class Config(BaseConfig):
use_enum_values: bool = True
arbitrary_types_allowed: bool = True
allow_population_by_field_name: bool = True
json_encoders: Dict[Any, FuncType] = {
fields.Base64: serialize_base64,
}
# TODO: ensure this is required by subclasses
__prisma_model__: ClassVar[str]
class BasePost(_PrismaModel):
__prisma_model__: ClassVar[Literal['Post']] = 'Post' # pyright: ignore[reportIncompatibleVariableOverride]
@classmethod
def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.PostActions[_PrismaModelT]':
from .client import get_client
return actions.PostActions[_PrismaModelT](client or get_client(), cls)
class BaseUser(_PrismaModel):
__prisma_model__: ClassVar[Literal['User']] = 'User' # pyright: ignore[reportIncompatibleVariableOverride]
@classmethod
def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.UserActions[_PrismaModelT]':
from .client import get_client
return actions.UserActions[_PrismaModelT](client or get_client(), cls)
class BaseM(_PrismaModel):
__prisma_model__: ClassVar[Literal['M']] = 'M' # pyright: ignore[reportIncompatibleVariableOverride]
@classmethod
def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.MActions[_PrismaModelT]':
from .client import get_client
return actions.MActions[_PrismaModelT](client or get_client(), cls)
class BaseN(_PrismaModel):
__prisma_model__: ClassVar[Literal['N']] = 'N' # pyright: ignore[reportIncompatibleVariableOverride]
@classmethod
def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.NActions[_PrismaModelT]':
from .client import get_client
return actions.NActions[_PrismaModelT](client or get_client(), cls)
class BaseOneOptional(_PrismaModel):
__prisma_model__: ClassVar[Literal['OneOptional']] = 'OneOptional' # pyright: ignore[reportIncompatibleVariableOverride]
@classmethod
def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.OneOptionalActions[_PrismaModelT]':
from .client import get_client
return actions.OneOptionalActions[_PrismaModelT](client or get_client(), cls)
class BaseManyRequired(_PrismaModel):
__prisma_model__: ClassVar[Literal['ManyRequired']] = 'ManyRequired' # pyright: ignore[reportIncompatibleVariableOverride]
@classmethod
def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.ManyRequiredActions[_PrismaModelT]':
from .client import get_client
return actions.ManyRequiredActions[_PrismaModelT](client or get_client(), cls)
class BaseLists(_PrismaModel):
__prisma_model__: ClassVar[Literal['Lists']] = 'Lists' # pyright: ignore[reportIncompatibleVariableOverride]
@classmethod
def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.ListsActions[_PrismaModelT]':
from .client import get_client
return actions.ListsActions[_PrismaModelT](client or get_client(), cls)
class BaseA(_PrismaModel):
__prisma_model__: ClassVar[Literal['A']] = 'A' # pyright: ignore[reportIncompatibleVariableOverride]
@classmethod
def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.AActions[_PrismaModelT]':
from .client import get_client
return actions.AActions[_PrismaModelT](client or get_client(), cls)
class BaseB(_PrismaModel):
__prisma_model__: ClassVar[Literal['B']] = 'B' # pyright: ignore[reportIncompatibleVariableOverride]
@classmethod
def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.BActions[_PrismaModelT]':
from .client import get_client
return actions.BActions[_PrismaModelT](client or get_client(), cls)
class BaseC(_PrismaModel):
__prisma_model__: ClassVar[Literal['C']] = 'C' # pyright: ignore[reportIncompatibleVariableOverride]
@classmethod
def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.CActions[_PrismaModelT]':
from .client import get_client
return actions.CActions[_PrismaModelT](client or get_client(), cls)
class BaseD(_PrismaModel):
__prisma_model__: ClassVar[Literal['D']] = 'D' # pyright: ignore[reportIncompatibleVariableOverride]
@classmethod
def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.DActions[_PrismaModelT]':
from .client import get_client
return actions.DActions[_PrismaModelT](client or get_client(), cls)
class BaseE(_PrismaModel):
__prisma_model__: ClassVar[Literal['E']] = 'E' # pyright: ignore[reportIncompatibleVariableOverride]
@classmethod
def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.EActions[_PrismaModelT]':
from .client import get_client
return actions.EActions[_PrismaModelT](client or get_client(), cls)
'''