ramifice 0.8.33__py3-none-any.whl → 0.8.35__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/__init__.py CHANGED
@@ -35,7 +35,7 @@ __all__ = (
35
35
  import logging
36
36
 
37
37
  from xloft import NamedTuple
38
- from xloft.humanism import to_human_size
38
+ from xloft.human import to_human_size
39
39
 
40
40
  from ramifice.models.decorator import model
41
41
  from ramifice.utils import translations
@@ -74,8 +74,8 @@ class DateGroupMixin:
74
74
  )
75
75
  )
76
76
  err_msg = translations._(
77
- "The date {} must not be greater than max={} !".format(value_str, max_date_str),
78
- )
77
+ "The date {} must not be greater than max={} !",
78
+ ).format(value_str, max_date_str)
79
79
  accumulate_error(err_msg, params)
80
80
  # Validation the `min_date` field attribute.
81
81
  min_date = field.min_date
@@ -107,8 +107,8 @@ class DateGroupMixin:
107
107
  )
108
108
  )
109
109
  err_msg = translations._(
110
- "The date {} must not be less than min={} !".format(value_str, min_date_str),
111
- )
110
+ "The date {} must not be less than min={} !",
111
+ ).format(value_str, min_date_str)
112
112
  accumulate_error(err_msg, params)
113
113
  # Insert result.
114
114
  if params["is_save"]:
@@ -9,7 +9,7 @@ __all__ = ("FileGroupMixin",)
9
9
 
10
10
  from typing import Any
11
11
 
12
- from xloft.humanism import to_human_size
12
+ from xloft.human import to_human_size
13
13
 
14
14
  from ramifice.paladins.tools import (
15
15
  accumulate_error,
@@ -70,8 +70,8 @@ class FileGroupMixin:
70
70
  if value["size"] > field.max_size:
71
71
  human_size = to_human_size(field.max_size)
72
72
  err_msg = translations._(
73
- "File size exceeds the maximum value {} !".format(human_size),
74
- )
73
+ "File size exceeds the maximum value {} !",
74
+ ).format(human_size)
75
75
  accumulate_error(err_msg, params)
76
76
  return
77
77
  # Insert result.
@@ -11,7 +11,7 @@ from asyncio import to_thread
11
11
  from typing import Any
12
12
 
13
13
  from PIL import Image
14
- from xloft.humanism import to_human_size
14
+ from xloft.human import to_human_size
15
15
 
16
16
  from ramifice.paladins.tools import accumulate_error, panic_type_error
17
17
  from ramifice.utils import translations
@@ -69,8 +69,8 @@ class ImgGroupMixin:
69
69
  if value["size"] > field.max_size:
70
70
  human_size = to_human_size(field.max_size)
71
71
  err_msg = translations._(
72
- "Image size exceeds the maximum value {} !".format(human_size),
73
- )
72
+ "Image size exceeds the maximum value {} !",
73
+ ).format(human_size)
74
74
  accumulate_error(err_msg, params)
75
75
  return
76
76
  # Create thumbnails.
@@ -52,15 +52,15 @@ class NumGroupMixin:
52
52
  max_number = field.max_number
53
53
  if max_number is not None and value > max_number:
54
54
  err_msg = translations._(
55
- "The value {} must not be greater than max={} !".format(value, max_number),
56
- )
55
+ "The value {} must not be greater than max={} !",
56
+ ).format(value, max_number)
57
57
  accumulate_error(err_msg, params)
58
58
  # Validation the `min_number` field attribute.
59
59
  min_number = field.min_number
60
60
  if min_number is not None and value < min_number:
61
61
  err_msg = translations._(
62
- "The value {} must not be less than min={} !".format(value, min_number),
63
- )
62
+ "The value {} must not be less than min={} !",
63
+ ).format(value, min_number)
64
64
  accumulate_error(err_msg, params)
65
65
  # Validation the `unique` field attribute.
66
66
  if field.unique and not await check_uniqueness(value, params, field_name):
@@ -47,7 +47,7 @@ class PassGroupMixin:
47
47
  err_msg = translations._("Invalid Password !")
48
48
  accumulate_error(err_msg, params)
49
49
  chars = "a-z A-Z 0-9 - . _ ! \" ` ' # % & , : ; < > = @ { } ~ $ ( ) * + / \\ ? [ ] ^ |"
50
- err_msg = translations._("Valid characters: {}".format(chars))
50
+ err_msg = translations._("Valid characters: {}").format(chars)
51
51
  accumulate_error(err_msg, params)
52
52
  err_msg = translations._("Number of characters: from 8 to 256")
53
53
  accumulate_error(err_msg, params)
@@ -66,8 +66,8 @@ class TextGroupMixin:
66
66
  maxlength: int | None = field.__dict__.get("maxlength")
67
67
  if maxlength is not None and len(field) > maxlength:
68
68
  err_msg = translations._(
69
- "The length of the string exceeds maxlength={} !".format(maxlength),
70
- )
69
+ "The length of the string exceeds maxlength={} !",
70
+ ).format(maxlength)
71
71
  accumulate_error(err_msg, params)
72
72
  # Validation the `unique` field attribute.
73
73
  if field.unique and not await check_uniqueness(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ramifice
3
- Version: 0.8.33
3
+ Version: 0.8.35
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/
@@ -174,7 +174,7 @@ class User:
174
174
  # Hint: By default = 2 MB
175
175
  max_size=524288, # 0.5 MB = 512 KB = 524288 Bytes (in binary)
176
176
  warning=[
177
- gettext("Maximum size: %s") % to_human_size(524288),
177
+ gettext("Maximum size: {}").format(to_human_size(524288)),
178
178
  ],
179
179
  )
180
180
  self.username = TextField(
@@ -183,7 +183,7 @@ class User:
183
183
  required=True,
184
184
  unique=True,
185
185
  warning=[
186
- gettext("Allowed chars: %s") % "a-z A-Z 0-9 _",
186
+ gettext("Allowed chars: {}").format("a-z A-Z 0-9 _"),
187
187
  ],
188
188
  )
189
189
  self.password = PasswordField(
@@ -203,7 +203,7 @@ class User:
203
203
 
204
204
  # Check username
205
205
  if re.match(r"^[a-zA-Z0-9_]+$", cd.username) is None:
206
- err.update("username", gettext("Allowed chars: %s") % "a-z A-Z 0-9 _")
206
+ err.update("username", gettext("Allowed chars: {}").format("a-z A-Z 0-9 _"))
207
207
 
208
208
  # Check password
209
209
  if cd._id is None and (cd.password != cd.сonfirm_password):
@@ -1,4 +1,4 @@
1
- ramifice/__init__.py,sha256=VWqmauH79bM0bPlbHJURZKwcOHJSEf97tpHpz5l7A8c,1622
1
+ ramifice/__init__.py,sha256=Ms9drE4wSvoUyzAtAa-VRykD7ufz6L_GtHx-YQRePDI,1619
2
2
  ramifice/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  ramifice/commons/__init__.py,sha256=RR_cVDF0H8xa56q2PXGKUSmYOPF-AUNKRY9u7DHD_KU,583
4
4
  ramifice/commons/general.py,sha256=zaWBzSLEaUC6Jl3uXwVKlteaGmh1Y3m1TKbRQ9YpNw0,5471
@@ -60,14 +60,14 @@ ramifice/paladins/validation.py,sha256=1g727ZO7E3Gj2k7qiVBMjOjdol2YGlRjxKcOsu6IP
60
60
  ramifice/paladins/groups/__init__.py,sha256=MmScWKa2cfEfowr2fUxH41VIVOkOpgz5ELTdJ8ez4Fc,996
61
61
  ramifice/paladins/groups/bool_group.py,sha256=yHdjC1MknQCQ-PssQRkxhQObE7U6XjlBTk40sa54a3M,879
62
62
  ramifice/paladins/groups/choice_group.py,sha256=PRuxCkDrWtoCyEhCn-WTPjub7RfoWEdSHJRyza3Nsc8,1886
63
- ramifice/paladins/groups/date_group.py,sha256=K6ViiwKGafaCFk3fXVnem6ElUgwZG3ECjHGzV5OKLSQ,3846
64
- ramifice/paladins/groups/file_group.py,sha256=EDXua0Dv44S4xlGlpKmF2oC_BUfY3MWKYz4DZuc0EFI,3028
63
+ ramifice/paladins/groups/date_group.py,sha256=Y2fFEX2elmE5QphDEOf-xhvmR6ryR34S9tSBpMspZY4,3846
64
+ ramifice/paladins/groups/file_group.py,sha256=8TI0CozyLar-uEQX7STxmrm3fqYDieQMyquydbyx-I4,3025
65
65
  ramifice/paladins/groups/id_group.py,sha256=PnWfH1LkpduMxU9Qpm6XhC1zeKb_KQNgGAFSASQm9q0,1359
66
- ramifice/paladins/groups/img_group.py,sha256=3uTOLd-RqNBa3U3shxGSMVhkuKTLtdqzX3lktnzSJCY,6182
67
- ramifice/paladins/groups/num_group.py,sha256=Faqsnf77CF0OZNcmhRhXh4eqEg5LxEC2DK6PKGe3XBs,2401
68
- ramifice/paladins/groups/pass_group.py,sha256=4NH303GixKbuU7EUdPRPmxrfrhN42oVn7Co0FtELbYg,1964
66
+ ramifice/paladins/groups/img_group.py,sha256=CygCrv-hzzFzmvI2U-CnuluB70oGIs05QYFHjr_GO8g,6179
67
+ ramifice/paladins/groups/num_group.py,sha256=-dQeE9IpeoLZ4hWw5YjeKdhPfV8U_TIwKAiFEjYzVzA,2401
68
+ ramifice/paladins/groups/pass_group.py,sha256=jRU2tQGEJjFnOJnW1uKlgib-ffA2aVncgNjlCS_rxfM,1964
69
69
  ramifice/paladins/groups/slug_group.py,sha256=zq1C-4XvL7vnM12FhzXYgDhgAgydrU1PlG70pP0pQnA,2543
70
- ramifice/paladins/groups/text_group.py,sha256=Qu1n-G86Gxk8oK2_16lA21g-QksTWLcmSFCmOB0xgcY,4555
70
+ ramifice/paladins/groups/text_group.py,sha256=8ejxKR0XZ7fzjnb6MwM3nyJU5GQI0Fnj9S3zJAMjqqw,4555
71
71
  ramifice/utils/__init__.py,sha256=lAD90nw2VfGSuf0SLjOkeFScBPmc48XFvecueAfq73w,468
72
72
  ramifice/utils/constants.py,sha256=a_sabPso9tgXnnG6fmWqNSb-3zyEGGS_lEXIqQU5nqQ,2835
73
73
  ramifice/utils/errors.py,sha256=n2Fs7qZHP3w7t8Kyb1uRnNHLjuDhjD37iZe60-UM70s,2846
@@ -77,7 +77,7 @@ ramifice/utils/mixins.py,sha256=5G3x8hK3igM7JBgCiCnVDdb_0K_D1gV1tw0QKpDlm-A,1161
77
77
  ramifice/utils/tools.py,sha256=WOazw24pvL96-0yNBy7YRGErN3vAQ4F6GS9TLvWFqrs,2747
78
78
  ramifice/utils/translations.py,sha256=YItvCWv-13FS2x8VYsAOH-Nx_qQOitOX7-bRGX3mc3A,4718
79
79
  ramifice/utils/unit.py,sha256=zHfvkyEU4sxHOc-QMuntEcvyfQqH75AK1zx8E25kM9Y,2535
80
- ramifice-0.8.33.dist-info/METADATA,sha256=Darwww-mGko50sGv1RaBfgNXtwYcqO9hExOrbct4kfg,21094
81
- ramifice-0.8.33.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
82
- ramifice-0.8.33.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
83
- ramifice-0.8.33.dist-info/RECORD,,
80
+ ramifice-0.8.35.dist-info/METADATA,sha256=-s9JbtD2V2Qv2wKlEYvtc8EvSc9l3cBPR7x8esFa7Sk,21112
81
+ ramifice-0.8.35.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
82
+ ramifice-0.8.35.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
83
+ ramifice-0.8.35.dist-info/RECORD,,