fastgenerateapi 1.1.12__py2.py3-none-any.whl → 1.1.13__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fastgenerateapi/__version__.py +1 -1
- fastgenerateapi/api_view/base_view.py +8 -8
- fastgenerateapi/fastapi_utils/param_utils.py +0 -2
- fastgenerateapi/model/base_model.py +2 -0
- fastgenerateapi/my_fields/soft_delete_field.py +2 -2
- {fastgenerateapi-1.1.12.dist-info → fastgenerateapi-1.1.13.dist-info}/METADATA +4 -4
- {fastgenerateapi-1.1.12.dist-info → fastgenerateapi-1.1.13.dist-info}/RECORD +10 -10
- {fastgenerateapi-1.1.12.dist-info → fastgenerateapi-1.1.13.dist-info}/LICENSE +0 -0
- {fastgenerateapi-1.1.12.dist-info → fastgenerateapi-1.1.13.dist-info}/WHEEL +0 -0
- {fastgenerateapi-1.1.12.dist-info → fastgenerateapi-1.1.13.dist-info}/top_level.txt +0 -0
fastgenerateapi/__version__.py
CHANGED
|
@@ -63,12 +63,10 @@ class BaseView(BaseMixin, ResponseMixin, ToolMixin, DBModelMixin):
|
|
|
63
63
|
if not self.model_class:
|
|
64
64
|
return self.error(msg="model_class not allow None")
|
|
65
65
|
model_class = self.model_class
|
|
66
|
-
|
|
66
|
+
delete_filter_dict = {settings.app_settings.WHETHER_DELETE_FIELD: True}
|
|
67
67
|
if settings.app_settings.DELETE_FIELD_TYPE == "time":
|
|
68
|
-
|
|
69
|
-
queryset = model_class.filter(**
|
|
70
|
-
delete_filter_field: True
|
|
71
|
-
})
|
|
68
|
+
delete_filter_dict = {settings.app_settings.WHETHER_DELETE_FIELD: 0}
|
|
69
|
+
queryset = model_class.filter(**delete_filter_dict)
|
|
72
70
|
|
|
73
71
|
return queryset
|
|
74
72
|
|
|
@@ -170,7 +168,7 @@ class BaseView(BaseMixin, ResponseMixin, ToolMixin, DBModelMixin):
|
|
|
170
168
|
if model and getattr(request_data, unique_field) == getattr(model, unique_field):
|
|
171
169
|
continue
|
|
172
170
|
if await model_class.filter(**{unique_field: getattr(request_data, unique_field)}).first():
|
|
173
|
-
self.fail(
|
|
171
|
+
self.fail(msg=f"{self.get_field_description(model_class, unique_field)}已存在相同值:{getattr(request_data, unique_field)}")
|
|
174
172
|
for unique_together_fields in check_unique_together_fields:
|
|
175
173
|
filter_fields = {}
|
|
176
174
|
is_equal = True
|
|
@@ -193,8 +191,10 @@ class BaseView(BaseMixin, ResponseMixin, ToolMixin, DBModelMixin):
|
|
|
193
191
|
continue
|
|
194
192
|
|
|
195
193
|
if await model_class.filter(**filter_fields).first():
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
if settings.app_settings.WHETHER_DELETE_FIELD in description_fields:
|
|
195
|
+
description_fields.remove(settings.app_settings.WHETHER_DELETE_FIELD)
|
|
196
|
+
return self.error(
|
|
197
|
+
msg=f"{self.get_field_description(model_class, description_fields)}已存在相同值:{[filter_fields.get(field) for field in description_fields]}"
|
|
198
198
|
)
|
|
199
199
|
|
|
200
200
|
# @staticmethod
|
|
@@ -27,8 +27,6 @@ def get_param_sub_dependant(
|
|
|
27
27
|
query_param_field = depends.dependency.model_fields.get(query_param.name)
|
|
28
28
|
if query_param_field:
|
|
29
29
|
query_param.field_info.description = query_param_field.description or query_param_field.title or ""
|
|
30
|
-
else:
|
|
31
|
-
query_param.field_info.description = query_param_field.description or query_param_field.title or ""
|
|
32
30
|
return dependant
|
|
33
31
|
|
|
34
32
|
|
|
@@ -27,8 +27,8 @@ class SoftDeleteField(BigIntField):
|
|
|
27
27
|
|
|
28
28
|
def __init__(self, **kwargs: Any) -> None:
|
|
29
29
|
kwargs.setdefault("index", True)
|
|
30
|
-
kwargs.setdefault("null",
|
|
31
|
-
kwargs.setdefault("default",
|
|
30
|
+
kwargs.setdefault("null", False)
|
|
31
|
+
kwargs.setdefault("default", 0)
|
|
32
32
|
kwargs.setdefault("description", "软删除")
|
|
33
33
|
super().__init__(**kwargs)
|
|
34
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fastgenerateapi
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.13
|
|
4
4
|
Summary: FastAPIView Class View
|
|
5
5
|
Author: ShiLiang
|
|
6
6
|
Author-email: 2509144896@qq.com
|
|
@@ -24,10 +24,10 @@ License-File: LICENSE
|
|
|
24
24
|
[Github](https://github.com/ShiLiangAPI)
|
|
25
25
|
|
|
26
26
|
#### 版本说明
|
|
27
|
-
最新版本:v1.1.7
|
|
27
|
+
最新版本:v1.1.7+
|
|
28
28
|
建议python版本:3.9+
|
|
29
|
-
推荐fastapi版本:0.103.2
|
|
30
|
-
推荐pydantic版本:2.11.5
|
|
29
|
+
推荐fastapi版本:0.103.2+
|
|
30
|
+
推荐pydantic版本:2.11.5+
|
|
31
31
|
|
|
32
32
|
稳定版本:v0.0.21
|
|
33
33
|
建议python版本:3.9+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
fastgenerateapi/__init__.py,sha256=eh2qtp7FbjrgaRX5b3H3UWpasFdNHbVFqLUhpqVbaTU,1287
|
|
2
|
-
fastgenerateapi/__version__.py,sha256=
|
|
2
|
+
fastgenerateapi/__version__.py,sha256=O1vSHwP1CokGmyIQTNR-1AryP35eS8hykDRa8WI-wcs,497
|
|
3
3
|
fastgenerateapi/api_view/__init__.py,sha256=zkaTX5JxsNfjF-dFeEbHfUB58vhPMjm6Iiqx9HgJOrY,14
|
|
4
4
|
fastgenerateapi/api_view/api_view.py,sha256=mfD8GB-hnyI2XO3tkSOlEa2FfBLdq0_Wqvp8gFrXFKU,1160
|
|
5
|
-
fastgenerateapi/api_view/base_view.py,sha256=
|
|
5
|
+
fastgenerateapi/api_view/base_view.py,sha256=cgdX1VYVjDYWXunBtHbglc5YW7J9Nuda4fLM0b_X4F4,10088
|
|
6
6
|
fastgenerateapi/api_view/create_view.py,sha256=NvJ0ocD2UMHcdipA4W7MYamxAw8sYeXAc176VAdkLek,4621
|
|
7
7
|
fastgenerateapi/api_view/delete_filter_view.py,sha256=ZP9pmRNeCTu_Go4ErfnDPnkPMShEh_Ql18iNCfMNJ3s,2838
|
|
8
8
|
fastgenerateapi/api_view/delete_tree_view.py,sha256=oqkWQNlA7TNZHHRTJJwxidOHxOgmvUpcnu81cT3oTA0,4083
|
|
@@ -55,16 +55,16 @@ fastgenerateapi/example/schemas.py,sha256=8UjQxy0lAvQ-nY2-PPNcsmzfg5TZJe0bVyhuIo
|
|
|
55
55
|
fastgenerateapi/example/views.py,sha256=eYy5jgcc-IVwKREMA3U4RNDku27Nn9NJU_Flwbp3R-4,3258
|
|
56
56
|
fastgenerateapi/fastapi_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
57
|
fastgenerateapi/fastapi_utils/all.py,sha256=QO-VcNGKFbpP7OfAl9EUtZYIjSvqSrHoyFjrQGfm8hc,79
|
|
58
|
-
fastgenerateapi/fastapi_utils/param_utils.py,sha256=
|
|
58
|
+
fastgenerateapi/fastapi_utils/param_utils.py,sha256=ja_3VRJyWQrOfxlbVrUHZtqDw18MfJ3iRs43IEfoOFY,1091
|
|
59
59
|
fastgenerateapi/fastapi_utils/response_utils.py,sha256=dqQHIeAe6N1zA5diUfDdGBQkyzZ82b-8GrgWzqrkw18,15922
|
|
60
60
|
fastgenerateapi/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
61
|
-
fastgenerateapi/model/base_model.py,sha256=
|
|
61
|
+
fastgenerateapi/model/base_model.py,sha256=EdPxjm0Nfpaj6-GzYISOvwWuexZzlqHAm2JD-3h6x4E,1869
|
|
62
62
|
fastgenerateapi/my_fields/__init__.py,sha256=StbTm3_2IBZ8U5kEWxtNyZ3I-Qs-pCFd5vtAZTq52wA,202
|
|
63
63
|
fastgenerateapi/my_fields/aes_field.py,sha256=r4_Jhuq5lgwmITWjUYcFrv5uBR57GPGCVMgy3yNDvp4,4518
|
|
64
64
|
fastgenerateapi/my_fields/enum_field.py,sha256=5aRaJ1caiNxAzD_sNlRqGxS-knX9iUHd3pk5hCAXBAo,7986
|
|
65
65
|
fastgenerateapi/my_fields/pk_field.py,sha256=0rZIylE98xyW9QNlInr-HN843sxChwpoO4wRumWNKw4,1317
|
|
66
66
|
fastgenerateapi/my_fields/pwd_field.py,sha256=eUnarxEyHgpOzTBmsl0KxsI8lR7FzUDjxyFCKTqJDBU,2191
|
|
67
|
-
fastgenerateapi/my_fields/soft_delete_field.py,sha256=
|
|
67
|
+
fastgenerateapi/my_fields/soft_delete_field.py,sha256=taB05-gif79EAfrueqSfFb-xOep5uZ25vfdc4D4aAqM,1450
|
|
68
68
|
fastgenerateapi/my_fields/validator.py,sha256=0mPsV4tOIw1YYuBCN7YJPYCWstIsCsy9K3b38ih1_JY,1981
|
|
69
69
|
fastgenerateapi/pydantic_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
70
70
|
fastgenerateapi/pydantic_utils/base_model.py,sha256=uZejyLi1KL1uNC9TlOVXVPGrxG0DWXedZVtvDYu3LlU,2239
|
|
@@ -103,8 +103,8 @@ fastgenerateapi/utils/snowflake.py,sha256=GiFVkE10sPiqJ094sMfrPsaV7Y9Y3c1djrSfgs
|
|
|
103
103
|
fastgenerateapi/utils/str_util.py,sha256=c-jUlCFw-Dz4W1W9Jc1TqGZw3JXu-qN5ovnE6fjc9j0,3445
|
|
104
104
|
fastgenerateapi/utils/swagger_to_js.py,sha256=pPPTag6TYtxdbKMHD3m8lJvc8Gv9HC97CGHt4esU1-E,530
|
|
105
105
|
script/__init__.py,sha256=26UWatnbm6ZIwQMuu9NNzQ0IW1ACO4Oe9caModuTpWM,4
|
|
106
|
-
fastgenerateapi-1.1.
|
|
107
|
-
fastgenerateapi-1.1.
|
|
108
|
-
fastgenerateapi-1.1.
|
|
109
|
-
fastgenerateapi-1.1.
|
|
110
|
-
fastgenerateapi-1.1.
|
|
106
|
+
fastgenerateapi-1.1.13.dist-info/LICENSE,sha256=gcuuhKKc5-dwvyvHsXjlC9oM6N5gZ6umYbC8ewW1Yvg,35821
|
|
107
|
+
fastgenerateapi-1.1.13.dist-info/METADATA,sha256=219VndvGuoJ8InOYf6nMR_Brk2tLAD8hioW0GWrKN14,5964
|
|
108
|
+
fastgenerateapi-1.1.13.dist-info/WHEEL,sha256=iYlv5fX357PQyRT2o6tw1bN-YcKFFHKqB_LwHO5wP-g,110
|
|
109
|
+
fastgenerateapi-1.1.13.dist-info/top_level.txt,sha256=CW2SlpYjTRdacF-5ufnPMtwpYcR0XYn_bDxa2ZrrTBI,23
|
|
110
|
+
fastgenerateapi-1.1.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|