ramifice 0.3.21__py3-none-any.whl → 0.3.23__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
@@ -1,10 +1,10 @@
1
- # Copyright 2018-present MongoDB, Inc.
1
+ # Copyright 2022-present MongoDB, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
5
5
  # You may obtain a copy of the License at
6
6
  #
7
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
8
  #
9
9
  # Unless required by applicable law or agreed to in writing, software
10
10
  # distributed under the License is distributed on an "AS IS" BASIS,
ramifice/decorators.py CHANGED
@@ -122,12 +122,13 @@ def caching(cls: Any, service_name: str, is_migrate_model: bool) -> dict[str, An
122
122
  # Count all fields.
123
123
  count_all_fields = 0
124
124
  # Count fields for migrating.
125
- count_fields_for_migrating = 0
125
+ count_fields_no_ignored = 0
126
126
 
127
127
  raw_model = cls()
128
128
  raw_model.fields()
129
- default_fields: dict[str, Any] = {"_id": IDField()}
129
+ default_fields: dict[str, Any] = {}
130
130
  if is_migrate_model:
131
+ default_fields["_id"] = IDField()
131
132
  default_fields["created_at"] = DateTimeField()
132
133
  default_fields["updated_at"] = DateTimeField()
133
134
  fields = {**raw_model.__dict__, **default_fields}
@@ -145,17 +146,24 @@ def caching(cls: Any, service_name: str, is_migrate_model: bool) -> dict[str, An
145
146
  if not f_type.ignored:
146
147
  # Count fields for migrating.
147
148
  if is_migrate_model:
148
- count_fields_for_migrating += 1
149
+ count_fields_no_ignored += 1
149
150
  # Get a dictionary of field names and types.
150
151
  field_name_and_type[f_name] = f_type_str
151
152
  # Build data migration storage for dynamic fields.
152
153
  if "Dyn" in f_type.field_type:
154
+ if not is_migrate_model:
155
+ msg = (
156
+ f"Model: `{cls.__module__}.{model_name}` > "
157
+ + f"Field: `{f_name}` => "
158
+ + "Dynamic field only for a migrated Model."
159
+ )
160
+ raise PanicError(msg)
153
161
  data_dynamic_fields[f_name] = None
154
162
 
155
163
  metadata["field_name_and_type"] = field_name_and_type
156
164
  metadata["field_attrs"] = field_attrs
157
165
  metadata["data_dynamic_fields"] = data_dynamic_fields
158
166
  metadata["count_all_fields"] = count_all_fields
159
- metadata["count_fields_for_migrating"] = count_fields_for_migrating
167
+ metadata["count_fields_no_ignored"] = count_fields_no_ignored
160
168
 
161
169
  return metadata
@@ -45,23 +45,28 @@ class CheckMixin(
45
45
  It is also used to verify Models that do not migrate to the database.
46
46
  """
47
47
  cls_model = self.__class__
48
- if not cls_model.META["is_migrate_model"] and is_save: # type: ignore[attr-defined]
48
+ is_migrate_model: bool = cls_model.META["is_migrate_model"] # type: ignore[attr-defined]
49
+
50
+ if not is_migrate_model and is_save:
49
51
  msg = (
50
52
  f"Model: `{self.full_model_name()}` > " # type: ignore[attr-defined]
51
53
  + "Method: `check` => "
52
- + "For a non-migrating Model, the `is_save` parameter cannot be equal to `True`!"
54
+ + "For a non -migrating Model, the `is_save` parameter must be equal to` False` !"
53
55
  )
54
56
  raise PanicError(msg)
55
- # Get the document ID.
56
- doc_id: ObjectId | None = self._id.value # type: ignore[attr-defined]
57
- # Does the document exist in the database?
58
- is_update: bool = doc_id is not None
59
- # Create an identifier for a new document.
60
- if not is_update:
61
- doc_id = ObjectId()
62
- if is_save and not is_update:
63
- self._id.value = doc_id # type: ignore[attr-defined]
64
- #
57
+
58
+ doc_id: ObjectId | None = None
59
+ is_update: bool = False
60
+ if is_migrate_model:
61
+ # Get the document ID.
62
+ doc_id = self._id.value # type: ignore[attr-defined]
63
+ # Does the document exist in the database?
64
+ is_update = doc_id is not None
65
+ # Create an identifier for a new document.
66
+ if is_save and not is_update:
67
+ doc_id = ObjectId()
68
+ self._id.value = doc_id # type: ignore[attr-defined]
69
+
65
70
  result_map: dict[str, Any] = {}
66
71
  # Errors from additional validation of fields.
67
72
  error_map: dict[str, str] = await self.add_validation() or {} # type: ignore[attr-defined]
@@ -78,8 +83,9 @@ class CheckMixin(
78
83
  "collection": collection,
79
84
  "field_data": None,
80
85
  "full_model_name": cls_model.META["full_model_name"], # type: ignore[attr-defined]
86
+ "is_migrate_model": is_migrate_model,
81
87
  }
82
- #
88
+
83
89
  # Run checking fields.
84
90
  for field_name, field_data in self.__dict__.items():
85
91
  if callable(field_data):
@@ -23,7 +23,7 @@ class BoolGroupMixin:
23
23
  value = field.value
24
24
 
25
25
  if not isinstance(value, (bool, type(None))):
26
- panic_type_error(params["full_model_name"], "bool | None", params)
26
+ panic_type_error("bool | None", params)
27
27
 
28
28
  if not params["is_update"] and value is None:
29
29
  value = field.default
@@ -32,14 +32,14 @@ class ChoiceGroupMixin:
32
32
  if value is None:
33
33
  if field.required:
34
34
  err_msg = translations._("Required field !")
35
- accumulate_error(params["full_model_name"], err_msg, params)
35
+ accumulate_error(err_msg, params)
36
36
  if params["is_save"]:
37
37
  params["result_map"][field.name] = None
38
38
  return
39
39
  # Does the field value match the possible options in choices.
40
40
  if not field.has_value():
41
41
  err_msg = translations._("Your choice does not match the options offered !")
42
- accumulate_error(params["full_model_name"], err_msg, params)
42
+ accumulate_error(err_msg, params)
43
43
  # Insert result.
44
44
  if params["is_save"]:
45
45
  params["result_map"][field.name] = value
@@ -27,12 +27,12 @@ class DateGroupMixin:
27
27
  value = field.value or field.default or None
28
28
 
29
29
  if not isinstance(value, (datetime, type(None))):
30
- panic_type_error(params["full_model_name"], "datetime | None", params)
30
+ panic_type_error("datetime | None", params)
31
31
 
32
32
  if value is None:
33
33
  if field.required:
34
34
  err_msg = translations._("Required field !")
35
- accumulate_error(params["full_model_name"], err_msg, params)
35
+ accumulate_error(err_msg, params)
36
36
  if params["is_save"]:
37
37
  params["result_map"][field.name] = None
38
38
  return
@@ -70,7 +70,7 @@ class DateGroupMixin:
70
70
  "The date %s must not be greater than max=%s !" % value_str,
71
71
  max_date_str,
72
72
  )
73
- accumulate_error(params["full_model_name"], err_msg, params)
73
+ accumulate_error(err_msg, params)
74
74
  # Validation the `min_date` field attribute.
75
75
  min_date = field.min_date
76
76
  if min_date is not None and value < min_date:
@@ -103,7 +103,7 @@ class DateGroupMixin:
103
103
  err_msg = translations._(
104
104
  "The date %s must not be less than min=%s !" % value_str, min_date_str
105
105
  )
106
- accumulate_error(params["full_model_name"], err_msg, params)
106
+ accumulate_error(err_msg, params)
107
107
  # Insert result.
108
108
  if params["is_save"]:
109
109
  params["result_map"][field.name] = value
@@ -22,7 +22,7 @@ class FileGroupMixin:
22
22
  value = field.value or None
23
23
 
24
24
  if not isinstance(value, (dict, type(None))):
25
- panic_type_error(params["full_model_name"], "dict | None", params)
25
+ panic_type_error("dict | None", params)
26
26
 
27
27
  if not params["is_update"]:
28
28
  if value is None:
@@ -36,7 +36,7 @@ class FileGroupMixin:
36
36
  if value is None:
37
37
  if field.required:
38
38
  err_msg = translations._("Required field !")
39
- accumulate_error(params["full_model_name"], err_msg, params)
39
+ accumulate_error(err_msg, params)
40
40
  if params["is_save"]:
41
41
  params["result_map"][field.name] = None
42
42
  return
@@ -57,14 +57,14 @@ class FileGroupMixin:
57
57
  params["result_map"][field.name] = None
58
58
  else:
59
59
  err_msg = translations._("Required field !")
60
- accumulate_error(params["full_model_name"], err_msg, params)
60
+ accumulate_error(err_msg, params)
61
61
  return
62
62
  # Accumulate an error if the file size exceeds the maximum value.
63
63
  if value["size"] > field.max_size:
64
64
  err_msg = translations._(
65
65
  "File size exceeds the maximum value %s !" % to_human_size(field.max_size)
66
66
  )
67
- accumulate_error(params["full_model_name"], err_msg, params)
67
+ accumulate_error(err_msg, params)
68
68
  return
69
69
  # Insert result.
70
70
  if params["is_save"] and (value["is_new_file"] or value["save_as_is"]):
@@ -23,22 +23,22 @@ class IDGroupMixin:
23
23
  """Checking id fields."""
24
24
  field = params["field_data"]
25
25
  # Get current value.
26
- value = field.value or None
26
+ value = field.value
27
27
 
28
28
  if not isinstance(value, (ObjectId, type(None))):
29
- panic_type_error(params["full_model_name"], "ObjectId | None", params)
29
+ panic_type_error("ObjectId | None", params)
30
30
 
31
31
  if value is None:
32
32
  if field.required:
33
33
  err_msg = translations._("Required field !")
34
- accumulate_error(params["full_model_name"], err_msg, params)
34
+ accumulate_error(err_msg, params)
35
35
  if params["is_save"]:
36
36
  params["result_map"][field.name] = None
37
37
  return
38
38
  # Validation of the MongoDB identifier in a string form.
39
39
  if not ObjectId.is_valid(value):
40
40
  err_msg = translations._("Invalid document ID !")
41
- accumulate_error(params["full_model_name"], err_msg, params)
41
+ accumulate_error(err_msg, params)
42
42
  # Insert result.
43
43
  if params["is_save"]:
44
44
  params["result_map"][field.name] = value
@@ -24,7 +24,7 @@ class ImgGroupMixin:
24
24
  value = field.value or None
25
25
 
26
26
  if not isinstance(value, (dict, type(None))):
27
- panic_type_error(params["full_model_name"], "dict | None", params)
27
+ panic_type_error("dict | None", params)
28
28
 
29
29
  if not params["is_update"]:
30
30
  if value is None:
@@ -38,7 +38,7 @@ class ImgGroupMixin:
38
38
  if value is None:
39
39
  if field.required:
40
40
  err_msg = translations._("Required field !")
41
- accumulate_error(params["full_model_name"], err_msg, params)
41
+ accumulate_error(err_msg, params)
42
42
  if params["is_save"]:
43
43
  params["result_map"][field.name] = None
44
44
  return
@@ -59,14 +59,14 @@ class ImgGroupMixin:
59
59
  params["result_map"][field.name] = None
60
60
  else:
61
61
  err_msg = translations._("Required field !")
62
- accumulate_error(params["full_model_name"], err_msg, params)
62
+ accumulate_error(err_msg, params)
63
63
  return
64
64
  # Accumulate an error if the file size exceeds the maximum value.
65
65
  if value["size"] > field.max_size:
66
66
  err_msg = translations._(
67
67
  "Image size exceeds the maximum value %s !" % to_human_size(field.max_size)
68
68
  )
69
- accumulate_error(params["full_model_name"], err_msg, params)
69
+ accumulate_error(err_msg, params)
70
70
  return
71
71
  # Create thumbnails.
72
72
  if value["is_new_img"]:
@@ -27,15 +27,15 @@ class NumGroupMixin:
27
27
 
28
28
  if "Float" in field.field_type:
29
29
  if not isinstance(value, (float, type(None))):
30
- panic_type_error(params["full_model_name"], "float | None", params)
30
+ panic_type_error("float | None", params)
31
31
  else:
32
32
  if not isinstance(value, (int, type(None))):
33
- panic_type_error(params["full_model_name"], "int | None", params)
33
+ panic_type_error("int | None", params)
34
34
 
35
35
  if value is None:
36
36
  if field.required:
37
37
  err_msg = translations._("Required field !")
38
- accumulate_error(params["full_model_name"], err_msg, params)
38
+ accumulate_error(err_msg, params)
39
39
  if params["is_save"]:
40
40
  params["result_map"][field.name] = None
41
41
  return
@@ -45,22 +45,18 @@ class NumGroupMixin:
45
45
  err_msg = translations._(
46
46
  "The value %d must not be greater than max=%d !" % value, max_number
47
47
  )
48
- accumulate_error(params["full_model_name"], err_msg, params)
48
+ accumulate_error(err_msg, params)
49
49
  # Validation the `min_number` field attribute.
50
50
  min_number = field.min_number
51
51
  if min_number is not None and value < min_number:
52
52
  err_msg = translations._(
53
53
  "The value %d must not be less than min=%d !" % value, min_number
54
54
  )
55
- accumulate_error(params["full_model_name"], err_msg, params)
55
+ accumulate_error(err_msg, params)
56
56
  # Validation the `unique` field attribute.
57
- if field.unique and not await check_uniqueness(
58
- self.__class__.META["is_migrate_model"], # type: ignore[attr-defined]
59
- value,
60
- params,
61
- ):
57
+ if field.unique and not await check_uniqueness(value, params):
62
58
  err_msg = translations._("Is not unique !")
63
- accumulate_error(params["full_model_name"], err_msg, params)
59
+ accumulate_error(err_msg, params)
64
60
  # Insert result.
65
61
  if params["is_save"]:
66
62
  params["result_map"][field.name] = value
@@ -28,24 +28,24 @@ class PassGroupMixin:
28
28
  value = field.value or None
29
29
 
30
30
  if not isinstance(value, (str, type(None))):
31
- panic_type_error(params["full_model_name"], "str | None", params)
31
+ panic_type_error("str | None", params)
32
32
 
33
33
  if value is None:
34
34
  if field.required:
35
35
  err_msg = translations._("Required field !")
36
- accumulate_error(params["full_model_name"], err_msg, params)
36
+ accumulate_error(err_msg, params)
37
37
  if params["is_save"]:
38
38
  params["result_map"][field.name] = None
39
39
  return
40
40
  # Validation Passwor.
41
41
  if not field.is_valid(value):
42
42
  err_msg = translations._("Invalid Password !")
43
- accumulate_error(params["full_model_name"], err_msg, params)
43
+ accumulate_error(err_msg, params)
44
44
  chars = "a-z A-Z 0-9 - . _ ! \" ` ' # % & , : ; < > = @ { } ~ $ ( ) * + / \\ ? [ ] ^ |"
45
45
  err_msg = translations._("Valid characters: %s" % chars)
46
- accumulate_error(params["full_model_name"], err_msg, params)
46
+ accumulate_error(err_msg, params)
47
47
  err_msg = translations._("Number of characters: from 8 to 256")
48
- accumulate_error(params["full_model_name"], err_msg, params)
48
+ accumulate_error(err_msg, params)
49
49
  # Insert result.
50
50
  if params["is_save"]:
51
51
  ph = PasswordHasher()
@@ -51,11 +51,7 @@ class SlugGroupMixin:
51
51
  # Convert to slug.
52
52
  value = slugify("-".join(raw_str_list))
53
53
  # Validation of uniqueness of the value.
54
- if not await check_uniqueness(
55
- self.__class__.META["is_migrate_model"], # type: ignore[attr-defined]
56
- value,
57
- params,
58
- ):
54
+ if not await check_uniqueness(value, params):
59
55
  err_msg = (
60
56
  f"Model: `{params['full_model_name']}` > "
61
57
  + f"Field: `{field.name}` > "
@@ -28,12 +28,12 @@ class TextGroupMixin:
28
28
  value = field.value or field.default or None
29
29
 
30
30
  if not isinstance(value, (str, type(None))):
31
- panic_type_error(params["full_model_name"], "str | None", params)
31
+ panic_type_error("str | None", params)
32
32
 
33
33
  if value is None:
34
34
  if field.required:
35
35
  err_msg = translations._("Required field !")
36
- accumulate_error(params["full_model_name"], err_msg, params)
36
+ accumulate_error(err_msg, params)
37
37
  if params["is_save"]:
38
38
  params["result_map"][field.name] = None
39
39
  return
@@ -41,15 +41,11 @@ class TextGroupMixin:
41
41
  maxlength: int | None = field.__dict__.get("maxlength")
42
42
  if maxlength is not None and len(value) > maxlength:
43
43
  err_msg = translations._("The length of the string exceeds maxlength=%d !" % maxlength)
44
- accumulate_error(params["full_model_name"], err_msg, params)
44
+ accumulate_error(err_msg, params)
45
45
  # Validation the `unique` field attribute.
46
- if field.unique and not await check_uniqueness(
47
- self.__class__.META["is_migrate_model"], # type: ignore[attr-defined]
48
- value,
49
- params,
50
- ):
46
+ if field.unique and not await check_uniqueness(value, params):
51
47
  err_msg = translations._("Is not unique !")
52
- accumulate_error(params["full_model_name"], err_msg, params)
48
+ accumulate_error(err_msg, params)
53
49
  # Validation Email, Url, IP, Color, Phone.
54
50
  field_type = field.field_type
55
51
  if "Email" in field_type:
@@ -62,19 +58,19 @@ class TextGroupMixin:
62
58
  params["field_data"].value = value
63
59
  except EmailNotValidError:
64
60
  err_msg = translations._("Invalid Email address !")
65
- accumulate_error(params["full_model_name"], err_msg, params)
61
+ accumulate_error(err_msg, params)
66
62
  elif "URL" in field_type and not field.is_valid(value):
67
63
  err_msg = translations._("Invalid URL address !")
68
- accumulate_error(params["full_model_name"], err_msg, params)
64
+ accumulate_error(err_msg, params)
69
65
  elif "IP" in field_type and not field.is_valid(value):
70
66
  err_msg = translations._("Invalid IP address !")
71
- accumulate_error(params["full_model_name"], err_msg, params)
67
+ accumulate_error(err_msg, params)
72
68
  elif "Color" in field_type and not field.is_valid(value):
73
69
  err_msg = translations._("Invalid Color code !")
74
- accumulate_error(params["full_model_name"], err_msg, params)
70
+ accumulate_error(err_msg, params)
75
71
  elif "Phone" in field_type and not field.is_valid(value):
76
72
  err_msg = translations._("Invalid Phone number !")
77
- accumulate_error(params["full_model_name"], err_msg, params)
73
+ accumulate_error(err_msg, params)
78
74
  # Insert result.
79
75
  if params["is_save"]:
80
76
  params["result_map"][field.name] = value
@@ -2,8 +2,6 @@
2
2
 
3
3
  from typing import Any
4
4
 
5
- from termcolor import colored
6
-
7
5
  from ..errors import PanicError
8
6
 
9
7
 
@@ -21,17 +19,17 @@ def refresh_from_mongo_doc(inst_model: Any, mongo_doc: dict[str, Any]) -> None:
21
19
  field.value = data if field.group != "pass" else None
22
20
 
23
21
 
24
- def panic_type_error(model_name: str, value_type: str, params: dict[str, Any]) -> None:
22
+ def panic_type_error(value_type: str, params: dict[str, Any]) -> None:
25
23
  """Unacceptable type of value."""
26
24
  msg = (
27
- f"Model: `{model_name}` > "
25
+ f"Model: `{params['full_model_name']}` > "
28
26
  + f"Field: `{params['field_data'].name}` > "
29
27
  + f"Parameter: `value` => Must be `{value_type}` type!"
30
28
  )
31
29
  raise PanicError(msg)
32
30
 
33
31
 
34
- def accumulate_error(model_name: str, err_msg: str, params: dict[str, Any]) -> None:
32
+ def accumulate_error(err_msg: str, params: dict[str, Any]) -> None:
35
33
  """For accumulating errors to ModelName.field_name.errors ."""
36
34
  if not params["field_data"].hide:
37
35
  params["field_data"].errors.append(err_msg)
@@ -39,7 +37,7 @@ def accumulate_error(model_name: str, err_msg: str, params: dict[str, Any]) -> N
39
37
  params["is_error_symptom"] = True
40
38
  else:
41
39
  msg = (
42
- f">>hidden field<< -> Model: `{model_name}` > "
40
+ f">>hidden field<< -> Model: `{params['full_model_name']}` > "
43
41
  + f"Field: `{params['field_data'].name}`"
44
42
  + f" => {err_msg}"
45
43
  )
@@ -47,12 +45,11 @@ def accumulate_error(model_name: str, err_msg: str, params: dict[str, Any]) -> N
47
45
 
48
46
 
49
47
  async def check_uniqueness(
50
- is_migrate_model: bool,
51
48
  value: str | int | float,
52
49
  params: dict[str, Any],
53
50
  ) -> bool:
54
51
  """Check the uniqueness of the value in the collection."""
55
- if not is_migrate_model:
52
+ if not params["is_migrate_model"]:
56
53
  return True
57
54
  q_filter = {
58
55
  "$and": [
ramifice/pseudo_model.py CHANGED
@@ -11,7 +11,7 @@ from bson.objectid import ObjectId
11
11
  from dateutil.parser import parse
12
12
 
13
13
  from . import translations
14
- from .fields import IDField # type: ignore[attr-defined]
14
+ from .errors import PanicError
15
15
 
16
16
 
17
17
  class PseudoModel(metaclass=ABCMeta):
@@ -23,28 +23,21 @@ class PseudoModel(metaclass=ABCMeta):
23
23
  META: dict[str, Any] = {}
24
24
 
25
25
  def __init__(self) -> None: # noqa: D107
26
- self._id = IDField(
27
- label="Stub",
28
- placeholder="Stub",
29
- hint="Stub",
30
- hide=True,
31
- disabled=True,
32
- )
33
26
  self.fields()
34
27
  self.inject()
28
+
35
29
  for _, f_type in self.__dict__.items():
36
- if not callable(f_type):
37
- if f_type.group == "img":
38
- f_type.__dict__["add_width_height"] = True
30
+ if not callable(f_type) and f_type.group == "img":
31
+ f_type.__dict__["add_width_height"] = True
39
32
 
40
33
  def __del__(self) -> None: # noqa: D105
41
34
  # If the model is not migrated,
42
35
  # it must delete files and images in the destructor.
43
36
  for _, f_type in self.__dict__.items():
44
- if not callable(f_type):
45
- value = f_type.value
46
- if value is None:
47
- continue
37
+ if callable(f_type):
38
+ continue
39
+ value = f_type.value
40
+ if value is not None:
48
41
  if f_type.group == "file":
49
42
  value = value.get("path")
50
43
  if value is not None:
@@ -73,13 +66,18 @@ class PseudoModel(metaclass=ABCMeta):
73
66
  metadata = self.__class__.META
74
67
  if bool(metadata):
75
68
  field_attrs = metadata["field_attrs"]
76
- data_dynamic_fields = metadata["data_dynamic_fields"]
77
69
  for f_name, f_type in self.__dict__.items():
78
- if not callable(f_type):
79
- f_type.id = field_attrs[f_name]["id"]
80
- f_type.name = field_attrs[f_name]["name"]
81
- if "Dyn" in f_type.field_type:
82
- f_type.choices = data_dynamic_fields[f_name]
70
+ if callable(f_type):
71
+ continue
72
+ f_type.id = field_attrs[f_name]["id"]
73
+ f_type.name = field_attrs[f_name]["name"]
74
+ if "Dyn" in f_type.field_type:
75
+ msg = (
76
+ f"Model: `{metadata['full_model_name']}` > "
77
+ + f"Field: `{f_name}` => "
78
+ + "Dynamic field only for a migrated Model."
79
+ )
80
+ raise PanicError(msg)
83
81
 
84
82
  # Complect of methods for converting Model to JSON and back.
85
83
  # --------------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ramifice
3
- Version: 0.3.21
3
+ Version: 0.3.23
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/
@@ -142,6 +142,7 @@ from ramifice.migration import Monitor
142
142
  @model(service_name="Accounts")
143
143
  class User:
144
144
  def fields(self):
145
+ # For custom translations.
145
146
  gettext = translations.gettext
146
147
  # ngettext = translations.ngettext
147
148
  self.avatar = ImageField(
@@ -1,6 +1,6 @@
1
- ramifice/__init__.py,sha256=ISlaL2BprlJLE_N1fvtAqGrB3Dhniy9IZGoyWEYZhRU,678
1
+ ramifice/__init__.py,sha256=jOSfXKsCkSk7y_mkKMF32gKotkD8V4RmQYvPh4smVVE,679
2
2
  ramifice/add_valid.py,sha256=kvpMg7snL9tor0A23XRdgwiXazRwHfb8baoJUNjM_4Y,327
3
- ramifice/decorators.py,sha256=X4UnHrbuMObv10dooNip3u9ihfdNvFqeMcfLNuhLlbg,6466
3
+ ramifice/decorators.py,sha256=VSAnaD8ZtDzpzNqdTgRKZcYGNm8aJQm9ITChGl4UcEM,6838
4
4
  ramifice/errors.py,sha256=iuhq7fzpUmsOyeXeg2fJjta8yAuqlXLKsZVMpfUhtHE,1901
5
5
  ramifice/fixtures.py,sha256=NtxOnZslYJb4yvRpZbs3ckugmTwHQFS_9iCt2zddOC0,3102
6
6
  ramifice/hooks.py,sha256=Ri-ISfMT-IHaLO2eAqg8CODCTs3HRTxSylqspUKnVf4,873
@@ -8,7 +8,7 @@ ramifice/indexing.py,sha256=wQpX2qei5Zc7iIq5yIV93Skp8Aa8ZD0vybnEk7cRuXs,271
8
8
  ramifice/migration.py,sha256=t_Rm1OUQYrlaPQQd1uS5S7EYMvSuKUcWzi7P4JMkrOw,11114
9
9
  ramifice/mixins.py,sha256=gKLmWQ-QrGO3K5_k-h1tDa08lkCql_dte2Jy05q1wsM,1125
10
10
  ramifice/model.py,sha256=xhLKosxnT3HkPr6j_BSkB7pvG2WNY_7uylcHo3Oq0vM,6521
11
- ramifice/pseudo_model.py,sha256=AdETZEvffFvHogtL0NYzp1rqLaI5lq3XcVX1n5v62bw,6816
11
+ ramifice/pseudo_model.py,sha256=K00TqtrO6QScfAswM3Rr5Y017PfbtEXHymGSJYYgA40,6744
12
12
  ramifice/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  ramifice/store.py,sha256=MpDEPvUvbs11FXjakNtHPm9MekIv5p1U3as2Y80lTyc,1860
14
14
  ramifice/translations.py,sha256=GNGE0ULAA0aOY5pTxUd3MQW-nVaKvp6BeXWEcsR0s0o,4048
@@ -58,25 +58,25 @@ ramifice/fields/general/file_group.py,sha256=n45KfPzFI_l5hXoKkPDG0Q-0mdC2obExV-3
58
58
  ramifice/fields/general/number_group.py,sha256=AqlCY-t6JHZ2QVBe7mk5nPt6z8M4VJ_RARRlSBoIxms,715
59
59
  ramifice/fields/general/text_group.py,sha256=gP6mUGXr-LTI1UegqgEMQ-5vtUJuJs0wDYKVkknW_5E,873
60
60
  ramifice/paladins/__init__.py,sha256=PIP3AXI2KBRXNcLJUF0d7ygJ7VLOAxlhb4HRKQ9MGYY,516
61
- ramifice/paladins/check.py,sha256=kseDMCMliRsYsldcRFo5itqroQQtHtcA_oNEd6wvfgU,6835
61
+ ramifice/paladins/check.py,sha256=h07UX4OKa_1X4Wt3rC-qAAZ8xd-d0rGYlqprXE4CXk0,7009
62
62
  ramifice/paladins/delete.py,sha256=RfCyew5tbBCT8u1c8nMgC2vIQlIWzu9Tvh6TuO7VBmM,3584
63
63
  ramifice/paladins/password.py,sha256=O1OvmeKuXbwtBX1sPTRVsoWYHPQn9isOe1rju6A3wbE,3264
64
64
  ramifice/paladins/refrash.py,sha256=DfBFGjPB6yYjga57GuCiWFBNHalmDO3EfMjkhgoWnVI,1207
65
65
  ramifice/paladins/save.py,sha256=7KxocEisEVYWkZtBpHZyP6drGMyOVvF2vaymm4HNHmg,4276
66
- ramifice/paladins/tools.py,sha256=LlrY3rtKmBBGXOd6Lf8w84jMULA5C6nwzpHIoN16ibc,2094
66
+ ramifice/paladins/tools.py,sha256=9RDjyRJ5j8E5jNxVYHx-L87hCxqpu9WadycGSz7LZY0,2038
67
67
  ramifice/paladins/validation.py,sha256=7lFDWjokUwMwVxWAVgd_GlWGpF4mukxIVpxvpdyA19A,1850
68
68
  ramifice/paladins/groups/__init__.py,sha256=hpqmWLsYAMvZHAbmMXluQSqLhkHOSTUAgLHyTM1LTYI,472
69
- ramifice/paladins/groups/bool_group.py,sha256=fpxCySJ5JL7w1dLFPX1025zEU8CRsWSyQyXb3Hr3Z2s,819
70
- ramifice/paladins/groups/choice_group.py,sha256=OJeZjpnqKnSF1_bechtNepCCPjmp54x1T0c28DAa11c,1777
71
- ramifice/paladins/groups/date_group.py,sha256=-IS9pAHXdWK7tO9KQ2UyG1uf7TA43DKYCOCtOM2_tZ0,3844
72
- ramifice/paladins/groups/file_group.py,sha256=9GzRY3sV8PYJh23ZPtMQYH5RDi4pibN-kIaSui4B5zY,3033
73
- ramifice/paladins/groups/id_group.py,sha256=tK3OL1pr-V8PHPyS7vmjmJi_sRU669EvkY_Fc4sRHzg,1352
74
- ramifice/paladins/groups/img_group.py,sha256=j184UyyYZ8gNuAivkP1A57o9JlrGS_0sht6QKiblbDs,5643
75
- ramifice/paladins/groups/num_group.py,sha256=Jvb-lwHxapQybbLerC4t-_yO8N7Coo1fIlZ9eAGHcGs,2508
76
- ramifice/paladins/groups/pass_group.py,sha256=SEKpR2voNQtmywugDXJKY4XqPTL91CrJ87h0QNMqQqs,1952
77
- ramifice/paladins/groups/slug_group.py,sha256=_IRil2PwpY7cH7WaExNksKz61kQjvc27blrEufgUB30,2323
78
- ramifice/paladins/groups/text_group.py,sha256=nYZGwAIsJD-tX8RBtFlWvngO9RU4V0CnREUhxvV2UDo,3493
79
- ramifice-0.3.21.dist-info/METADATA,sha256=4pWgH5EVC0dvdG2SGf4smhNUkvdXzbOEymF3YcYfvzQ,18904
80
- ramifice-0.3.21.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
81
- ramifice-0.3.21.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
82
- ramifice-0.3.21.dist-info/RECORD,,
69
+ ramifice/paladins/groups/bool_group.py,sha256=oJc9mw9KGrnK_Pj7uXixYYQAJphcXLr_xSQv3PMUlcU,792
70
+ ramifice/paladins/groups/choice_group.py,sha256=ZV6t6qgh__BzWGRUSx2RdXH_K9BtBOo0eAZ3Yon0tfY,1723
71
+ ramifice/paladins/groups/date_group.py,sha256=bVhzmwsN3sKbmzvm4jI0i_Mzjwn8gdx4kxCUWq-0Yqs,3736
72
+ ramifice/paladins/groups/file_group.py,sha256=AtGu2sQ9A64dPo2Kpt4milp5HWPdULdPdQycwFW8ZgE,2925
73
+ ramifice/paladins/groups/id_group.py,sha256=zAlJrDTOdRY9e7eFYSXPjjsD05A4EsgSE6ibN3KKOMU,1263
74
+ ramifice/paladins/groups/img_group.py,sha256=o0bMI1WIA6t1QrhLaR2bBAAJUKCgHg7SiIFQsGTr2Cg,5535
75
+ ramifice/paladins/groups/num_group.py,sha256=lpyFG9a6WGOzu9f_9jwYVWZNFHxG0B0AVWvvbv_2mV0,2224
76
+ ramifice/paladins/groups/pass_group.py,sha256=7EXqssszWQaDldJgvyNFFPxj1KSdCN89xFXrfYTTZTQ,1817
77
+ ramifice/paladins/groups/slug_group.py,sha256=SVYxHcSSgCA51C18LVGxMQYuUw-6ryQlTi6B9T8Dzsw,2185
78
+ ramifice/paladins/groups/text_group.py,sha256=N_uHsL-JJnNp2JIzNxmNyK9hRupdZGTx9Cbe6muKSmI,3128
79
+ ramifice-0.3.23.dist-info/METADATA,sha256=yvhJPp8JUOSszvNnN1oZwHJfRunW0sX4b4Xzk_L724Y,18939
80
+ ramifice-0.3.23.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
81
+ ramifice-0.3.23.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
82
+ ramifice-0.3.23.dist-info/RECORD,,