ramifice 0.5.1__py3-none-any.whl → 0.5.3__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.5.1
3
+ Version: 0.5.3
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/
@@ -175,7 +175,7 @@ class User:
175
175
  # Hint: By default = 2 MB
176
176
  max_size=524288, # 512 KB = 0.5 MB = 524288 Bytes (in binary)
177
177
  warning=[
178
- gettext("Maximum size: %s" % to_human_size(524288)),
178
+ gettext("Maximum size: %s") % to_human_size(524288),
179
179
  ],
180
180
  )
181
181
  self.username = TextField(
@@ -185,7 +185,7 @@ class User:
185
185
  required=True,
186
186
  unique=True,
187
187
  warning=[
188
- gettext("Allowed chars: %s" % "a-z A-Z 0-9 _"),
188
+ gettext("Allowed chars: %s") % "a-z A-Z 0-9 _",
189
189
  ],
190
190
  )
191
191
  self.first_name = TextField(
@@ -272,7 +272,7 @@ class User:
272
272
  сonfirm_password = self.сonfirm_password.value
273
273
 
274
274
  if re.match(r"^[a-zA-Z0-9_]+$", username) is None: # type: ignore[arg-type]
275
- error_map["username"] = gettext("Allowed chars: %s" % "a-z A-Z 0-9 _")
275
+ error_map["username"] = gettext("Allowed chars: %s") % "a-z A-Z 0-9 _"
276
276
 
277
277
  if id is None and (password != сonfirm_password):
278
278
  error_map["password"] = gettext("Passwords do not match!")
@@ -328,12 +328,10 @@ async def main():
328
328
  else:
329
329
  print("No User!")
330
330
 
331
- # Remove User.
332
- await user.delete(remove_files=False)
333
-
334
331
  # Remove User.
335
332
  # (if necessary)
336
333
  # await user.delete()
334
+ # await user.delete(remove_files=False)
337
335
 
338
336
  # Remove collection.
339
337
  # (if necessary)
@@ -344,60 +342,9 @@ if __name__ == "__main__":
344
342
  asyncio.run(main())
345
343
  ```
346
344
 
347
- ### How to create custom translations ?
348
-
349
- ```python
350
- from ramifice import translations
351
-
352
- translations.DEFAULT_LOCALE = "en" # For Ramifice by default = "en"
353
- translations.LANGUAGES = ["en", "ru"] # For Ramifice by default = ["en", "ru"]
354
- ```
355
-
356
- ```shell
357
- cd project_name
358
- # Add your custom translations:
359
- uv run pybabel extract -o config/translations/custom.pot src
360
- uv run pybabel init -i config/translations/custom.pot -d config/translations/custom -l en
361
- uv run pybabel init -i config/translations/custom.pot -d config/translations/custom -l ru
362
- ...
363
-
364
- # Hint: Do not forget to add translations for new languages.
365
- uv run pybabel compile -d config/translations/custom
366
-
367
- # Update your custom translations:
368
- uv run pybabel extract -o config/translations/custom.pot src
369
- uv run pybabel update -i config/translations/custom.pot -d config/translations/custom
370
- # Hint: Do not forget to check the translations for existing languages.
371
- uv run pybabel compile -d config/translations/custom
372
- ```
373
-
374
- ### How to add new languages ​​to Ramifice ?
375
-
376
- ```python
377
- from ramifice import translations
378
-
379
- translations.DEFAULT_LOCALE = "en" # For Ramifice by default = "en"
380
- translations.LANGUAGES = ["en", "ru", "de", "de_ch"] # For Ramifice by default = ["en", "ru"]
381
- ```
382
-
383
- ```shell
384
- cd project_name
385
- # Example:
386
- uv run pybabel init -i config/translations/ramifice.pot -d config/translations/ramifice -l de
387
- uv run pybabel init -i config/translations/ramifice.pot -d config/translations/ramifice -l de_ch
388
- ...
389
-
390
- # Hint: Do not forget to add translations for new languages.
391
- uv run pybabel compile -d config/translations/ramifice
392
-
393
- # Update translations to Ramifice:
394
- uv run pybabel extract -o config/translations/ramifice.pot ramifice
395
- uv run pybabel update -i config/translations/ramifice.pot -d config/translations/ramifice
396
- # Hint: Do not forget to check the translations for existing languages.
397
- uv run pybabel compile -d config/translations/ramifice
398
- ```
345
+ ### How to add localization?
399
346
 
400
- ### [See more examples here.](https://github.com/kebasyaty/ramifice/tree/v0/examples "See more examples here.")
347
+ [See in the examples.](https://github.com/kebasyaty/ramifice/tree/v0/examples "See in the examples.")
401
348
 
402
349
  ## Model Parameters
403
350
 
@@ -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.5.1.dist-info/METADATA,sha256=TdHC07yAg5Z-s1O2V8fKVkJ_BCncdHf9ig1f9AarYt4,24406
83
- ramifice-0.5.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
- ramifice-0.5.1.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
85
- ramifice-0.5.1.dist-info/RECORD,,
82
+ ramifice-0.5.3.dist-info/METADATA,sha256=58pSq3FozgQeGrLrBroRfRJk1ohZVLIVQityHj6GdrU,22500
83
+ ramifice-0.5.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
+ ramifice-0.5.3.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
85
+ ramifice-0.5.3.dist-info/RECORD,,