@@ -2,103 +2,43 @@ from . import Field
2
2
from .mixins import CheckFieldDefaultMixin
3
3
from django .db .models import lookups
4
4
from django .db .models .lookups import PostgresOperatorLookup , Transform
5
- from typing import Any , Optional
5
+ from typing import Any , Optional , Callable
6
+
6
7
7
8
class JSONField (CheckFieldDefaultMixin , Field ):
8
- empty_strings_allowed : bool = ...
9
- description : Any = ...
10
- default_error_messages : Any = ...
11
- encoder : Any = ...
12
- decoder : Any = ...
13
9
def __init__ (
14
10
self ,
15
- verbose_name : Optional [Any ] = ...,
16
- name : Optional [Any ] = ...,
17
- encoder : Optional [Any ] = ...,
18
- decoder : Optional [Any ] = ...,
11
+ verbose_name : Optional [str ] = ...,
12
+ name : Optional [str ] = ...,
13
+ encoder : Optional [Callable ] = ...,
14
+ decoder : Optional [Callable ] = ...,
19
15
** kwargs : Any
20
16
) -> None : ...
21
- def check (self , ** kwargs : Any ): ...
22
- def deconstruct (self ): ...
23
- def from_db_value (self , value : Any , expression : Any , connection : Any ): ...
24
- def get_internal_type (self ): ...
25
- def get_prep_value (self , value : Any ): ...
26
- def get_transform (self , name : Any ): ...
27
- def validate (self , value : Any , model_instance : Any ) -> None : ...
28
17
def value_to_string (self , obj : Any ): ...
29
- def formfield (self , ** kwargs : Any ): ...
30
-
31
- class DataContains (PostgresOperatorLookup ):
32
- lookup_name : str = ...
33
- postgres_operator : str = ...
34
- def as_sql (self , compiler : Any , connection : Any ): ...
35
-
36
- class ContainedBy (PostgresOperatorLookup ):
37
- lookup_name : str = ...
38
- postgres_operator : str = ...
39
- def as_sql (self , compiler : Any , connection : Any ): ...
40
-
41
- class HasKeyLookup (PostgresOperatorLookup ):
42
- logical_operator : Any = ...
43
- def as_sql (self , compiler : Any , connection : Any , template : Optional [Any ] = ...): ...
44
- def as_mysql (self , compiler : Any , connection : Any ): ...
45
- def as_oracle (self , compiler : Any , connection : Any ): ...
46
- lhs : Any = ...
47
- rhs : Any = ...
48
- def as_postgresql (self , compiler : Any , connection : Any ): ...
49
- def as_sqlite (self , compiler : Any , connection : Any ): ...
50
-
51
- class HasKey (HasKeyLookup ):
52
- lookup_name : str = ...
53
- postgres_operator : str = ...
54
- prepare_rhs : bool = ...
55
-
56
- class HasKeys (HasKeyLookup ):
57
- lookup_name : str = ...
58
- postgres_operator : str = ...
59
- logical_operator : str = ...
60
- def get_prep_lookup (self ): ...
61
18
62
- class HasAnyKeys (HasKeys ):
63
- lookup_name : str = ...
64
- postgres_operator : str = ...
65
- logical_operator : str = ...
19
+ class DataContains (PostgresOperatorLookup ): ...
20
+ class ContainedBy (PostgresOperatorLookup ): ...
66
21
67
- class JSONExact (lookups .Exact ):
68
- can_use_none_as_rhs : bool = ...
69
- def process_rhs (self , compiler : Any , connection : Any ): ...
22
+ class HasKeyLookup (PostgresOperatorLookup ): ...
23
+ class HasKey (HasKeyLookup ): ...
24
+ class HasKeys (HasKeyLookup ): ...
25
+ class HasAnyKeys (HasKeys ): ...
26
+ class JSONExact (lookups .Exact ): ...
70
27
71
28
class KeyTransform (Transform ):
72
- postgres_operator : str = ...
73
- postgres_nested_operator : str = ...
74
29
key_name : Any = ...
75
30
def __init__ (self , key_name : Any , * args : Any , ** kwargs : Any ) -> None : ...
76
31
def preprocess_lhs (self , compiler : Any , connection : Any , lhs_only : bool = ...): ...
77
- def as_mysql (self , compiler : Any , connection : Any ): ...
78
- def as_oracle (self , compiler : Any , connection : Any ): ...
79
- def as_postgresql (self , compiler : Any , connection : Any ): ...
80
-
81
- class KeyTextTransform (KeyTransform ):
82
- postgres_operator : str = ...
83
- postgres_nested_operator : str = ...
84
32
33
+ class KeyTextTransform (KeyTransform ): ...
85
34
class KeyTransformTextLookupMixin :
86
35
def __init__ (self , key_transform : Any , * args : Any , ** kwargs : Any ) -> None : ...
87
36
88
- class CaseInsensitiveMixin :
89
- def process_rhs (self , compiler : Any , connection : Any ): ...
90
-
91
- class KeyTransformIsNull (lookups .IsNull ):
92
- def as_oracle (self , compiler : Any , connection : Any ): ...
93
- def as_sqlite (self , compiler : Any , connection : Any ): ...
94
-
95
- class KeyTransformIn (lookups .In ):
96
- def process_rhs (self , compiler : Any , connection : Any ): ...
97
-
98
- class KeyTransformExact (JSONExact ):
99
- def process_rhs (self , compiler : Any , connection : Any ): ...
100
- def as_oracle (self , compiler : Any , connection : Any ): ...
37
+ class CaseInsensitiveMixin : ...
38
+ class KeyTransformIsNull (lookups .IsNull ): ...
39
+ class KeyTransformIn (lookups .In ): ...
101
40
41
+ class KeyTransformExact (JSONExact ): ...
102
42
class KeyTransformIExact (CaseInsensitiveMixin , KeyTransformTextLookupMixin , lookups .IExact ): ...
103
43
class KeyTransformIContains (CaseInsensitiveMixin , KeyTransformTextLookupMixin , lookups .IContains ): ...
104
44
class KeyTransformStartsWith (KeyTransformTextLookupMixin , lookups .StartsWith ): ...
@@ -108,9 +48,7 @@ class KeyTransformIEndsWith(CaseInsensitiveMixin, KeyTransformTextLookupMixin, l
108
48
class KeyTransformRegex (KeyTransformTextLookupMixin , lookups .Regex ): ...
109
49
class KeyTransformIRegex (CaseInsensitiveMixin , KeyTransformTextLookupMixin , lookups .IRegex ): ...
110
50
111
- class KeyTransformNumericLookupMixin :
112
- def process_rhs (self , compiler : Any , connection : Any ): ...
113
-
51
+ class KeyTransformNumericLookupMixin : ...
114
52
class KeyTransformLt (KeyTransformNumericLookupMixin , lookups .LessThan ): ...
115
53
class KeyTransformLte (KeyTransformNumericLookupMixin , lookups .LessThanOrEqual ): ...
116
54
class KeyTransformGt (KeyTransformNumericLookupMixin , lookups .GreaterThan ): ...
0 commit comments