ramifice 0.3.32__py3-none-any.whl → 0.3.34__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.
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ramifice
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.34
|
4
4
|
Summary: ORM-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/
|
@@ -180,11 +180,13 @@ class User:
|
|
180
180
|
ignored=True,
|
181
181
|
)
|
182
182
|
|
183
|
+
# Optional method.
|
183
184
|
async def add_validation(self) -> dict[str, str]:
|
184
185
|
"""Additional validation of fields."""
|
186
|
+
gettext = translations.gettext
|
185
187
|
error_map: dict[str, str] = {}
|
186
188
|
if self.password != self.сonfirm_password:
|
187
|
-
error_map["password"] = "Passwords do not match!"
|
189
|
+
error_map["password"] = gettext("Passwords do not match!")
|
188
190
|
return error_map
|
189
191
|
|
190
192
|
|
@@ -209,19 +211,22 @@ async def main():
|
|
209
211
|
user.password.value = "12345678"
|
210
212
|
user.сonfirm_password.value = "12345678"
|
211
213
|
|
214
|
+
# Create User.
|
212
215
|
if not await user.save():
|
213
|
-
|
216
|
+
# Convenient to use during development.
|
217
|
+
user.print_err()
|
214
218
|
|
215
|
-
|
216
|
-
|
219
|
+
# Update User.
|
220
|
+
user.username.value = "pythondev-123"
|
221
|
+
if not await user.save():
|
222
|
+
user.print_err()
|
217
223
|
|
218
224
|
print("User details:")
|
219
225
|
user_details = await User.find_one_to_raw_doc({"_id": user._id.value})
|
220
226
|
pprint.pprint(user_details)
|
221
227
|
|
228
|
+
# Remove User.
|
222
229
|
await user.delete(remove_files=False)
|
223
|
-
doc_count = await User.estimated_document_count()
|
224
|
-
print(f"Document count: {doc_count}") # => 0
|
225
230
|
|
226
231
|
await client.close()
|
227
232
|
|
@@ -79,7 +79,7 @@ ramifice/utils/mixins/add_valid.py,sha256=TLOObedzXNA9eCylfAVbVCqIKE5sV-P5AdIN7a
|
|
79
79
|
ramifice/utils/mixins/hooks.py,sha256=33jvJRhfnJeL2Hd_YFXk3M_7wjqHaByU2wRjKyboL6s,914
|
80
80
|
ramifice/utils/mixins/indexing.py,sha256=Z0427HoaVRyNmSNN8Fx0mSICgAKV-gDdu3iR5qYUEbs,329
|
81
81
|
ramifice/utils/mixins/json_converter.py,sha256=WhigXyDAV-FfILaZuwvRFRIk0D90Rv3dG5t-mv5fVyc,1107
|
82
|
-
ramifice-0.3.
|
83
|
-
ramifice-0.3.
|
84
|
-
ramifice-0.3.
|
85
|
-
ramifice-0.3.
|
82
|
+
ramifice-0.3.34.dist-info/METADATA,sha256=rSgkCAXvxcA4ZrFQuzpy4R4igA3Ce67A64YasrDl7a0,20719
|
83
|
+
ramifice-0.3.34.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
84
|
+
ramifice-0.3.34.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
|
85
|
+
ramifice-0.3.34.dist-info/RECORD,,
|
File without changes
|
File without changes
|