biased 0.1.2.dev10__tar.gz → 0.1.2.dev12__tar.gz
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.
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/PKG-INFO +1 -1
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/pyproject.toml +1 -1
- biased-0.1.2.dev12/src/biased/consts.py +1 -0
- biased-0.1.2.dev12/src/biased/django/forms/ulid_form_field.py +12 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/types.py +15 -11
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/README.md +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/admin.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/apps.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/aws_waf/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/aws_waf/aws_waf_regex_pattern.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/aws_waf/aws_waf_whitelist_middleware.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/aws_waf/url_patterns.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/dtos.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/filters/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/filters/entity_filter.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/filters/input_filter.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/forms/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/forms/json_editor_widget.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/forms/pydantic_model_form_field.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/models/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/models/bank_account.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/models/char_field.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/models/created_at_modified_at_mixin.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/models/default_money_amount_field.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/models/deleted_at_mixin.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/models/multi_select_field.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/models/pydantic_model_field.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/templates/actions_change_form.html +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/templates/admin/input_filter.html +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/utils/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/utils/choices.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/utils/get_client_ip.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/utils/reverse.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django_jsonform/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django_jsonform/apps.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django_jsonform/jsonform_action.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django_jsonform/templates/admin_form_action/django_jsonform_form.html +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django_redis/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django_redis/pydantic_serializer.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/dtos/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/dtos/base.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/dtos/env_file_paths.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/dtos/logging.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/logging/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/logging/dict_config.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/logging/settings.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/logging/utils.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/ninja/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/ninja/json_renderrer.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/structlog/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/structlog/processors.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/structlog/structlog_json_encoder.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/utils/__init__.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/utils/aba_routing_number.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/utils/attrgetter_default.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/utils/calculate_age.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/utils/default_json_encoder.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/utils/filter_not_none_values.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/utils/time.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/utils/ulid.py +0 -0
- {biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/utils/uuid.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: biased
|
|
3
|
-
Version: 0.1.2.
|
|
3
|
+
Version: 0.1.2.dev12
|
|
4
4
|
Summary: Various reusable components, helpers, and utilities which I would like to use in any Python project
|
|
5
5
|
Author: Dmitry Tatarkin
|
|
6
6
|
Author-email: Dmitry Tatarkin <tatarkin@gmail.com>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ULID_PATTERN = r"^0[0-9A-HJKMNP-TV-Z]{25}$"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from django import forms
|
|
2
|
+
from django.core.validators import RegexValidator
|
|
3
|
+
|
|
4
|
+
from biased.consts import ULID_PATTERN
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class UlidFormField(forms.CharField):
|
|
8
|
+
def __init__(self, *args, **kwargs):
|
|
9
|
+
kwargs["min_length"] = 26
|
|
10
|
+
kwargs["max_length"] = 26
|
|
11
|
+
kwargs["validators"] = [RegexValidator(ULID_PATTERN)]
|
|
12
|
+
super().__init__(*args, **kwargs)
|
|
@@ -12,6 +12,7 @@ from pydantic import AfterValidator, AnyUrl, BaseModel, BeforeValidator, PlainSe
|
|
|
12
12
|
from pydantic.json_schema import Examples, SkipJsonSchema
|
|
13
13
|
from pydantic_core import Url
|
|
14
14
|
|
|
15
|
+
from biased.consts import ULID_PATTERN
|
|
15
16
|
from biased.utils.aba_routing_number import validate_aba_routing_number
|
|
16
17
|
|
|
17
18
|
|
|
@@ -64,9 +65,13 @@ NonNegativeMoneyAmount = Annotated[MoneyAmount, annotated_types.Ge(0)]
|
|
|
64
65
|
|
|
65
66
|
ItemsPerPageLimit = Annotated[int, annotated_types.Ge(0), annotated_types.Le(100)]
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
AsciiStrConstraints = StringConstraints(strict=True, pattern=r"^[ -~]*$")
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
AsciiStr = Annotated[str, AsciiStrConstraints]
|
|
71
|
+
|
|
72
|
+
AlphanumStrConstraints = StringConstraints(strict=True, pattern=r"^[a-zA-Z0-9]+$")
|
|
73
|
+
|
|
74
|
+
AlphanumStr = Annotated[str, AlphanumStrConstraints]
|
|
70
75
|
|
|
71
76
|
JsonPrimitiveTypes = (
|
|
72
77
|
str
|
|
@@ -121,7 +126,7 @@ UlidStr = Annotated[
|
|
|
121
126
|
to_upper=True,
|
|
122
127
|
min_length=26,
|
|
123
128
|
max_length=26,
|
|
124
|
-
pattern=
|
|
129
|
+
pattern=ULID_PATTERN,
|
|
125
130
|
),
|
|
126
131
|
AfterValidator(lambda x: ulid.parse(x).str),
|
|
127
132
|
# This Examples annotation leads to "😱 Could not render Parameters, see the console." in Swagger
|
|
@@ -131,11 +136,10 @@ UlidStr = Annotated[
|
|
|
131
136
|
# WithJsonSchema({'type': 'string', 'example': ulid.new().str})
|
|
132
137
|
]
|
|
133
138
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
]
|
|
139
|
+
NotEmptyStringConstraints = StringConstraints(
|
|
140
|
+
strict=True,
|
|
141
|
+
strip_whitespace=True,
|
|
142
|
+
min_length=1,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
NotEmptyString = Annotated[str, NotEmptyStringConstraints]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/aws_waf/aws_waf_regex_pattern.py
RENAMED
|
File without changes
|
{biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/aws_waf/aws_waf_whitelist_middleware.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/forms/pydantic_model_form_field.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/models/created_at_modified_at_mixin.py
RENAMED
|
File without changes
|
{biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/models/default_money_amount_field.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/templates/actions_change_form.html
RENAMED
|
File without changes
|
{biased-0.1.2.dev10 → biased-0.1.2.dev12}/src/biased/django/templates/admin/input_filter.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|