ramifice 0.5.2__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.
|
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!")
|
@@ -342,60 +342,9 @@ if __name__ == "__main__":
|
|
342
342
|
asyncio.run(main())
|
343
343
|
```
|
344
344
|
|
345
|
-
### How to
|
345
|
+
### How to add localization?
|
346
346
|
|
347
|
-
|
348
|
-
from ramifice import translations
|
349
|
-
|
350
|
-
translations.DEFAULT_LOCALE = "en" # For Ramifice by default = "en"
|
351
|
-
translations.LANGUAGES = ["en", "ru"] # For Ramifice by default = ["en", "ru"]
|
352
|
-
```
|
353
|
-
|
354
|
-
```shell
|
355
|
-
cd project_name
|
356
|
-
# Add your custom translations:
|
357
|
-
uv run pybabel extract -o config/translations/custom.pot src
|
358
|
-
uv run pybabel init -i config/translations/custom.pot -d config/translations/custom -l en
|
359
|
-
uv run pybabel init -i config/translations/custom.pot -d config/translations/custom -l ru
|
360
|
-
...
|
361
|
-
|
362
|
-
# Hint: Do not forget to add translations for new languages.
|
363
|
-
uv run pybabel compile -d config/translations/custom
|
364
|
-
|
365
|
-
# Update your custom translations:
|
366
|
-
uv run pybabel extract -o config/translations/custom.pot src
|
367
|
-
uv run pybabel update -i config/translations/custom.pot -d config/translations/custom
|
368
|
-
# Hint: Do not forget to check the translations for existing languages.
|
369
|
-
uv run pybabel compile -d config/translations/custom
|
370
|
-
```
|
371
|
-
|
372
|
-
### How to add new languages to Ramifice ?
|
373
|
-
|
374
|
-
```python
|
375
|
-
from ramifice import translations
|
376
|
-
|
377
|
-
translations.DEFAULT_LOCALE = "en" # For Ramifice by default = "en"
|
378
|
-
translations.LANGUAGES = ["en", "ru", "de", "de_ch"] # For Ramifice by default = ["en", "ru"]
|
379
|
-
```
|
380
|
-
|
381
|
-
```shell
|
382
|
-
cd project_name
|
383
|
-
# Example:
|
384
|
-
uv run pybabel init -i config/translations/ramifice.pot -d config/translations/ramifice -l de
|
385
|
-
uv run pybabel init -i config/translations/ramifice.pot -d config/translations/ramifice -l de_ch
|
386
|
-
...
|
387
|
-
|
388
|
-
# Hint: Do not forget to add translations for new languages.
|
389
|
-
uv run pybabel compile -d config/translations/ramifice
|
390
|
-
|
391
|
-
# Update translations to Ramifice:
|
392
|
-
uv run pybabel extract -o config/translations/ramifice.pot ramifice
|
393
|
-
uv run pybabel update -i config/translations/ramifice.pot -d config/translations/ramifice
|
394
|
-
# Hint: Do not forget to check the translations for existing languages.
|
395
|
-
uv run pybabel compile -d config/translations/ramifice
|
396
|
-
```
|
397
|
-
|
398
|
-
### [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.")
|
399
348
|
|
400
349
|
## Model Parameters
|
401
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.
|
83
|
-
ramifice-0.5.
|
84
|
-
ramifice-0.5.
|
85
|
-
ramifice-0.5.
|
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,,
|
File without changes
|
File without changes
|