ramifice 0.3.30__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.
@@ -89,7 +89,7 @@ class FileField(Field, FileGroup, JsonMixin):
89
89
  )
90
90
  JsonMixin.__init__(self)
91
91
 
92
- self.value: dict[str, Any] | None = None
92
+ self.value: dict[str, str | int | bool] | None = None
93
93
 
94
94
  def from_base64(
95
95
  self,
@@ -123,7 +123,7 @@ class ImageField(Field, FileGroup, JsonMixin):
123
123
  )
124
124
  JsonMixin.__init__(self)
125
125
 
126
- self.value: dict[str, Any] | None = None
126
+ self.value: dict[str, str | int | bool] | None = None
127
127
  # Available 4 sizes from lg to xs or None.
128
128
  # Example: {"lg": 1200, "md": 600, "sm": 300, "xs": 150 }
129
129
  self.thumbnails = thumbnails
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ramifice
3
- Version: 0.3.30
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
- user.print_err() # Convenient to use during development.
216
+ # Convenient to use during development.
217
+ user.print_err()
214
218
 
215
- doc_count = await User.estimated_document_count()
216
- print(f"Document count: {doc_count}") # => 1
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
 
@@ -25,10 +25,10 @@ ramifice/fields/color_field.py,sha256=NdYey3Og8hh7oK7yDljrG6K8frgqj4C2OTXFnJVAYF
25
25
  ramifice/fields/date_field.py,sha256=w875p6JwssKhEZJLBHmC8sE5wArn161rlQi0Zt-qEZo,5214
26
26
  ramifice/fields/date_time_field.py,sha256=OGi-ED-Gm_AWGzczHA1qch59IuWy3KkVIJHQl3OlatU,5249
27
27
  ramifice/fields/email_field.py,sha256=jEIcWi6glmpK3x3os-b-IFxlrwho4uS4uIamprtg2_M,3433
28
- ramifice/fields/file_field.py,sha256=ZikmAleY7G8fU0hVxXWFVP_M8FX9JAOoyypSTYYs1CE,7928
28
+ ramifice/fields/file_field.py,sha256=nMaVqVD61dH2TYN3ewAcT7xkYCtHuBcl4aSeoCcIDmA,7941
29
29
  ramifice/fields/float_field.py,sha256=o6rkcoYJB0Lyq4GkDxP3v4mUS-nKUgYCxNQkmgbTjlY,4585
30
30
  ramifice/fields/id_field.py,sha256=1_K1pfjYO7mNDs5W2zUHOiB5Y5vw0g02TPoGiBC2IYY,4135
31
- ramifice/fields/image_field.py,sha256=eyyKRGYK277feiNeNwzIlNJ1DQhBpg0FuuDPzZSxCw4,12305
31
+ ramifice/fields/image_field.py,sha256=yxJLHZKYACoJMp_TrjhCDj1NHTG5uoDC45nD63YI474,12318
32
32
  ramifice/fields/integer_field.py,sha256=O-nddXEn7rkkqB-SgJxLPRTRHmPstrO-IfYiGR_ADe8,4561
33
33
  ramifice/fields/ip_field.py,sha256=tsxdwKd-MhkhnE1F2FmFg67jwh9Q-RvXECv1aG8PitE,3342
34
34
  ramifice/fields/password_field.py,sha256=m3n_qJRRHCtgyBC7nDB0dYBO_82Lp1Ws48d1_jxHA8o,3216
@@ -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.30.dist-info/METADATA,sha256=LW96_DyC4OMVHMorgTAPR5SmbT6-2guMvdNST7US2KY,20695
83
- ramifice-0.3.30.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
- ramifice-0.3.30.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
85
- ramifice-0.3.30.dist-info/RECORD,,
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,,