cardo-python-utils 0.5.dev43__tar.gz → 0.5.dev45__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.
- {cardo_python_utils-0.5.dev43/cardo_python_utils.egg-info → cardo_python_utils-0.5.dev45}/PKG-INFO +1 -1
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45/cardo_python_utils.egg-info}/PKG-INFO +1 -1
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/cardo_python_utils.egg-info/SOURCES.txt +3 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/pyproject.toml +1 -1
- cardo_python_utils-0.5.dev45/python_utils/django/migrations/0001_initial.py +154 -0
- cardo_python_utils-0.5.dev45/python_utils/django/models/__init__.py +0 -0
- cardo_python_utils-0.5.dev45/python_utils/django/models/user.py +25 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/LICENSE +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/MANIFEST.in +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/README.rst +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/cardo_python_utils.egg-info/dependency_links.txt +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/cardo_python_utils.egg-info/requires.txt +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/cardo_python_utils.egg-info/top_level.txt +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/choices.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/data_structures.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/db.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/README.md +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/admin/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/admin/auth.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/admin/templates/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/admin/templates/user_groups_changelist.html +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/admin/user_group.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/admin/views.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/api/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/api/drf.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/api/ninja.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/api/utils.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/apps.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/auth/service.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/celery/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/celery/tenant_aware_database_scheduler.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/celery/tenant_aware_task.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/db/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/db/routers.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/db/transaction.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/db/utils.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/management/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/management/commands/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/management/commands/migrateall.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/management/commands/tenant_aware_command.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/middleware/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/middleware/tenant_aware_http_middleware.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/middleware/tenant_aware_websocket_middleware.py +0 -0
- {cardo_python_utils-0.5.dev43/python_utils/django/models → cardo_python_utils-0.5.dev45/python_utils/django/migrations}/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/models/user_group.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/oidc_settings.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/redis/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/redis/key_function.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/settings.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/storage/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/storage/tenant_aware_storage.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/tenant_context.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/tests/__init__.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/tests/conftest.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django_utils.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/esma_choices.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/exceptions.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/imports.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/math.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/text.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/time.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/types_hinting.py +0 -0
- {cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/setup.cfg +0 -0
|
@@ -50,7 +50,10 @@ python_utils/django/management/commands/tenant_aware_command.py
|
|
|
50
50
|
python_utils/django/middleware/__init__.py
|
|
51
51
|
python_utils/django/middleware/tenant_aware_http_middleware.py
|
|
52
52
|
python_utils/django/middleware/tenant_aware_websocket_middleware.py
|
|
53
|
+
python_utils/django/migrations/0001_initial.py
|
|
54
|
+
python_utils/django/migrations/__init__.py
|
|
53
55
|
python_utils/django/models/__init__.py
|
|
56
|
+
python_utils/django/models/user.py
|
|
54
57
|
python_utils/django/models/user_group.py
|
|
55
58
|
python_utils/django/redis/__init__.py
|
|
56
59
|
python_utils/django/redis/key_function.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cardo-python-utils"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.dev45"
|
|
8
8
|
description = "Python library enhanced with a wide range of functions for different scenarios."
|
|
9
9
|
readme = "README.rst"
|
|
10
10
|
requires-python = ">=3.8"
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import django.contrib.auth.models
|
|
2
|
+
import django.contrib.auth.validators
|
|
3
|
+
import django.utils.timezone
|
|
4
|
+
from django.db import migrations, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
initial = True
|
|
9
|
+
|
|
10
|
+
dependencies = [
|
|
11
|
+
("auth", "0012_alter_user_first_name_max_length"),
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
operations = [
|
|
15
|
+
migrations.SeparateDatabaseAndState(
|
|
16
|
+
state_operations=[
|
|
17
|
+
migrations.CreateModel(
|
|
18
|
+
name="User",
|
|
19
|
+
fields=[
|
|
20
|
+
(
|
|
21
|
+
"id",
|
|
22
|
+
models.AutoField(
|
|
23
|
+
auto_created=True,
|
|
24
|
+
primary_key=True,
|
|
25
|
+
serialize=False,
|
|
26
|
+
verbose_name="ID",
|
|
27
|
+
),
|
|
28
|
+
),
|
|
29
|
+
(
|
|
30
|
+
"password",
|
|
31
|
+
models.CharField(max_length=128, verbose_name="password"),
|
|
32
|
+
),
|
|
33
|
+
(
|
|
34
|
+
"last_login",
|
|
35
|
+
models.DateTimeField(blank=True, null=True, verbose_name="last login"),
|
|
36
|
+
),
|
|
37
|
+
(
|
|
38
|
+
"is_superuser",
|
|
39
|
+
models.BooleanField(
|
|
40
|
+
default=False,
|
|
41
|
+
help_text=(
|
|
42
|
+
"Designates that this user has all permissions without explicitly assigning them."
|
|
43
|
+
),
|
|
44
|
+
verbose_name="superuser status",
|
|
45
|
+
),
|
|
46
|
+
),
|
|
47
|
+
(
|
|
48
|
+
"username",
|
|
49
|
+
models.CharField(
|
|
50
|
+
error_messages={"unique": "A user with that username already exists."},
|
|
51
|
+
help_text=("Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."),
|
|
52
|
+
max_length=150,
|
|
53
|
+
unique=True,
|
|
54
|
+
validators=[django.contrib.auth.validators.UnicodeUsernameValidator()],
|
|
55
|
+
verbose_name="username",
|
|
56
|
+
),
|
|
57
|
+
),
|
|
58
|
+
(
|
|
59
|
+
"first_name",
|
|
60
|
+
models.CharField(blank=True, max_length=150, verbose_name="first name"),
|
|
61
|
+
),
|
|
62
|
+
(
|
|
63
|
+
"last_name",
|
|
64
|
+
models.CharField(blank=True, max_length=150, verbose_name="last name"),
|
|
65
|
+
),
|
|
66
|
+
(
|
|
67
|
+
"email",
|
|
68
|
+
models.EmailField(
|
|
69
|
+
blank=True,
|
|
70
|
+
max_length=254,
|
|
71
|
+
verbose_name="email address",
|
|
72
|
+
),
|
|
73
|
+
),
|
|
74
|
+
(
|
|
75
|
+
"is_staff",
|
|
76
|
+
models.BooleanField(
|
|
77
|
+
default=False,
|
|
78
|
+
help_text=("Designates whether the user can log into this admin site."),
|
|
79
|
+
verbose_name="staff status",
|
|
80
|
+
),
|
|
81
|
+
),
|
|
82
|
+
(
|
|
83
|
+
"is_active",
|
|
84
|
+
models.BooleanField(
|
|
85
|
+
default=True,
|
|
86
|
+
help_text=(
|
|
87
|
+
"Designates whether this user should be treated "
|
|
88
|
+
"as active. Unselect this instead of deleting "
|
|
89
|
+
"accounts."
|
|
90
|
+
),
|
|
91
|
+
verbose_name="active",
|
|
92
|
+
),
|
|
93
|
+
),
|
|
94
|
+
(
|
|
95
|
+
"date_joined",
|
|
96
|
+
models.DateTimeField(
|
|
97
|
+
default=django.utils.timezone.now,
|
|
98
|
+
verbose_name="date joined",
|
|
99
|
+
),
|
|
100
|
+
),
|
|
101
|
+
(
|
|
102
|
+
"is_demo",
|
|
103
|
+
models.BooleanField(
|
|
104
|
+
default=False,
|
|
105
|
+
help_text="Whether this user is a demo user.",
|
|
106
|
+
),
|
|
107
|
+
),
|
|
108
|
+
(
|
|
109
|
+
"groups",
|
|
110
|
+
models.ManyToManyField(
|
|
111
|
+
blank=True,
|
|
112
|
+
help_text=(
|
|
113
|
+
"The groups this user belongs to. A user will "
|
|
114
|
+
"get all permissions granted to each of their "
|
|
115
|
+
"groups."
|
|
116
|
+
),
|
|
117
|
+
related_name="idp_user_set",
|
|
118
|
+
related_query_name="user",
|
|
119
|
+
to="auth.group",
|
|
120
|
+
verbose_name="groups",
|
|
121
|
+
),
|
|
122
|
+
),
|
|
123
|
+
(
|
|
124
|
+
"user_permissions",
|
|
125
|
+
models.ManyToManyField(
|
|
126
|
+
blank=True,
|
|
127
|
+
help_text="Specific permissions for this user.",
|
|
128
|
+
related_name="idp_user_set",
|
|
129
|
+
related_query_name="user",
|
|
130
|
+
to="auth.permission",
|
|
131
|
+
verbose_name="user permissions",
|
|
132
|
+
),
|
|
133
|
+
),
|
|
134
|
+
],
|
|
135
|
+
options={
|
|
136
|
+
"db_table": "idp_user_user",
|
|
137
|
+
},
|
|
138
|
+
managers=[
|
|
139
|
+
("objects", django.contrib.auth.models.UserManager()),
|
|
140
|
+
],
|
|
141
|
+
),
|
|
142
|
+
],
|
|
143
|
+
database_operations=[
|
|
144
|
+
migrations.RunSQL(
|
|
145
|
+
sql="ALTER TABLE IF EXISTS auth_user RENAME TO idp_user_user;",
|
|
146
|
+
reverse_sql="ALTER TABLE IF EXISTS idp_user_user RENAME TO auth_user;",
|
|
147
|
+
),
|
|
148
|
+
],
|
|
149
|
+
),
|
|
150
|
+
migrations.RunSQL(
|
|
151
|
+
sql="DROP TABLE IF EXISTS idp_user_userrole CASCADE;",
|
|
152
|
+
reverse_sql=migrations.RunSQL.noop,
|
|
153
|
+
),
|
|
154
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from django.contrib.auth.models import AbstractUser, Group, Permission
|
|
2
|
+
from django.db import models
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class User(AbstractUser):
|
|
6
|
+
is_demo = models.BooleanField(default=False, null=False, help_text="Whether this user is a demo user.")
|
|
7
|
+
groups = models.ManyToManyField(
|
|
8
|
+
Group,
|
|
9
|
+
verbose_name="groups",
|
|
10
|
+
blank=True,
|
|
11
|
+
help_text=("The groups this user belongs to. A user will get all permissions granted to each of their groups."),
|
|
12
|
+
related_name="idp_user_set",
|
|
13
|
+
related_query_name="user",
|
|
14
|
+
)
|
|
15
|
+
user_permissions = models.ManyToManyField(
|
|
16
|
+
Permission,
|
|
17
|
+
verbose_name="user permissions",
|
|
18
|
+
blank=True,
|
|
19
|
+
help_text="Specific permissions for this user.",
|
|
20
|
+
related_name="idp_user_set",
|
|
21
|
+
related_query_name="user",
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
class Meta:
|
|
25
|
+
db_table = "idp_user_user"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/data_structures.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/__init__.py
RENAMED
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/admin/__init__.py
RENAMED
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/admin/auth.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/admin/views.py
RENAMED
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/api/__init__.py
RENAMED
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/api/drf.py
RENAMED
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/api/ninja.py
RENAMED
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/api/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/auth/service.py
RENAMED
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/celery/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/db/__init__.py
RENAMED
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/db/routers.py
RENAMED
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/db/transaction.py
RENAMED
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/db/utils.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
|
|
File without changes
|
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/oidc_settings.py
RENAMED
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/redis/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/settings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/tenant_context.py
RENAMED
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/tests/__init__.py
RENAMED
|
File without changes
|
{cardo_python_utils-0.5.dev43 → cardo_python_utils-0.5.dev45}/python_utils/django/tests/conftest.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
|
|
File without changes
|
|
File without changes
|