ramifice 0.8.16__py3-none-any.whl → 0.8.18__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.
- ramifice/models/model.py +4 -2
- ramifice/paladins/check.py +1 -1
- ramifice/utils/mixins/add_valid.py +1 -2
- {ramifice-0.8.16.dist-info → ramifice-0.8.18.dist-info}/METADATA +7 -9
- {ramifice-0.8.16.dist-info → ramifice-0.8.18.dist-info}/RECORD +7 -7
- {ramifice-0.8.16.dist-info → ramifice-0.8.18.dist-info}/WHEEL +0 -0
- {ramifice-0.8.16.dist-info → ramifice-0.8.18.dist-info}/licenses/LICENSE +0 -0
ramifice/models/model.py
CHANGED
@@ -190,10 +190,12 @@ class Model(metaclass=ABCMeta):
|
|
190
190
|
self.__dict__[name].value = value
|
191
191
|
|
192
192
|
# --------------------------------------------------------------------------
|
193
|
-
def get_clean_data(self) -> dict[str, Any]:
|
193
|
+
def get_clean_data(self) -> tuple[dict[str, Any], dict[str, str]]:
|
194
194
|
"""Get clean data."""
|
195
195
|
clean_data: dict[str, Any] = {}
|
196
|
+
|
196
197
|
for name, data in self.__dict__.items():
|
197
198
|
if not callable(data):
|
198
199
|
clean_data[name] = data.value
|
199
|
-
|
200
|
+
|
201
|
+
return (clean_data, {})
|
ramifice/paladins/check.py
CHANGED
@@ -65,7 +65,7 @@ class CheckMixin(
|
|
65
65
|
|
66
66
|
result_map: dict[str, Any] = {}
|
67
67
|
# Errors from additional validation of fields.
|
68
|
-
error_map: dict[str, str] = await self.add_validation()
|
68
|
+
error_map: dict[str, str] = await self.add_validation()
|
69
69
|
# Get Model collection.
|
70
70
|
if collection is None:
|
71
71
|
collection = constants.MONGO_DATABASE[cls_model.META["collection_name"]]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ramifice
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.18
|
4
4
|
Summary: ORM-pseudo-like API MongoDB for Python language.
|
5
5
|
Project-URL: Homepage, https://github.com/kebasyaty/ramifice
|
6
6
|
Project-URL: Documentation, https://kebasyaty.github.io/ramifice/
|
@@ -192,19 +192,17 @@ class User:
|
|
192
192
|
async def add_validation(self) -> dict[str, str]:
|
193
193
|
"""Additional validation of fields."""
|
194
194
|
gettext = translations.gettext
|
195
|
-
|
196
|
-
|
197
|
-
# Get clean data
|
198
|
-
cd: dict[str, Any] = self.get_clean_data()
|
195
|
+
cd, err = self.get_clean_data()
|
199
196
|
|
200
197
|
# Check username
|
201
198
|
if re.match(r"^[a-zA-Z0-9_]+$", cd["username"]) is None:
|
202
|
-
|
199
|
+
err["username"] = gettext("Allowed chars: %s") % "a-z A-Z 0-9 _"
|
203
200
|
|
204
201
|
# Check password
|
205
|
-
if cd["
|
206
|
-
|
207
|
-
|
202
|
+
if cd["_id"] is None and (cd["password"] != cd["сonfirm_password"]):
|
203
|
+
err["password"] = gettext("Passwords do not match!")
|
204
|
+
|
205
|
+
return err
|
208
206
|
|
209
207
|
|
210
208
|
async def main():
|
@@ -45,9 +45,9 @@ ramifice/fields/general/number_group.py,sha256=jspiA9hWiU_hNhXbTku2rZG3UezrhEVBG
|
|
45
45
|
ramifice/fields/general/text_group.py,sha256=hYVX4-ipD2_eyj-WpHIHnFrpQevySaVd4twffUsrOLo,1164
|
46
46
|
ramifice/models/__init__.py,sha256=y5jRhSzcPuEVUWr1u--o1GyjFb7irlf5Rn2gPvQ3IPg,26
|
47
47
|
ramifice/models/decorator.py,sha256=PX6b8DTP_Qz1SjyPcZ1vGDS4AGRZ6ZD8z8y6497j-DM,6685
|
48
|
-
ramifice/models/model.py,sha256=
|
48
|
+
ramifice/models/model.py,sha256=ufBWkAHvZjP3kN9x-VMPVq7k6vHhxcTvECV-BvaP6dc,7750
|
49
49
|
ramifice/paladins/__init__.py,sha256=I2FzvCrp6upv_GPLfDqaVLwIT6-3Dp_K9i51tFUXDuc,673
|
50
|
-
ramifice/paladins/check.py,sha256=
|
50
|
+
ramifice/paladins/check.py,sha256=L7mYsN5qp6ZlGiyPBQK1jw4GN03aIh8QpbbdK6-n6S4,6968
|
51
51
|
ramifice/paladins/delete.py,sha256=Ynew5zvEBRJNmss5I8hSIp7KgBHpSvDEJCwOfMH5MUU,3723
|
52
52
|
ramifice/paladins/password.py,sha256=hdEfSwz0a9FJ5IIYpyD9bmV_kNGvXP4OV5Ea-V0Yx98,3341
|
53
53
|
ramifice/paladins/refrash.py,sha256=0qst0ii2ThH-VJduSI1zgkuZQGLnR8IiIu5rTVxzM9U,1254
|
@@ -74,11 +74,11 @@ ramifice/utils/tools.py,sha256=LZyA715HnkNO7TcBu4Ia29A6Ko3n-F2BRULzIyNKt9o,3279
|
|
74
74
|
ramifice/utils/translations.py,sha256=Jh0nzwcn3bhUU2TjPAQboe3_pkVyhYQYdeINyC5SQo8,4701
|
75
75
|
ramifice/utils/unit.py,sha256=ToBeu92tzOY32fuzLdxScNeYXvGIDr0nx7yTv2DShVo,2604
|
76
76
|
ramifice/utils/mixins/__init__.py,sha256=fTsjH8h4OGvFC4zGawLLbU2i-c2OBdPftC3A-ZT5Pbw,379
|
77
|
-
ramifice/utils/mixins/add_valid.py,sha256=
|
77
|
+
ramifice/utils/mixins/add_valid.py,sha256=00eIBlgsUU1TfDo1rUQT5zw7_Iv9IubORTbzuKoVB5o,425
|
78
78
|
ramifice/utils/mixins/hooks.py,sha256=h8coNstWWHI4VwPgpjx0NWTj93-5NDAGtav0VFh-fk4,1031
|
79
79
|
ramifice/utils/mixins/indexing.py,sha256=WVLxmkLKg-C_LHn2hq6LJuOkSr9eS-XUUvCMgK-pKYo,387
|
80
80
|
ramifice/utils/mixins/json_converter.py,sha256=qBqFYol3Pbq1kX33EWB6FsYUL3AGSdYNtQE97HQ9jy4,1225
|
81
|
-
ramifice-0.8.
|
82
|
-
ramifice-0.8.
|
83
|
-
ramifice-0.8.
|
84
|
-
ramifice-0.8.
|
81
|
+
ramifice-0.8.18.dist-info/METADATA,sha256=NKDPQCc_IzbwiTH9TWzEbyYQnDlnahYPrTa-22Rf574,20869
|
82
|
+
ramifice-0.8.18.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
83
|
+
ramifice-0.8.18.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
|
84
|
+
ramifice-0.8.18.dist-info/RECORD,,
|
File without changes
|
File without changes
|