cardo-python-utils 0.5.dev45__py3-none-any.whl → 0.5.dev46__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cardo-python-utils
3
- Version: 0.5.dev45
3
+ Version: 0.5.dev46
4
4
  Summary: Python library enhanced with a wide range of functions for different scenarios.
5
5
  Author-email: CardoAI <hello@cardoai.com>
6
6
  License: MIT
@@ -1,4 +1,4 @@
1
- cardo_python_utils-0.5.dev45.dist-info/licenses/LICENSE,sha256=N-YtxDy8n5A1Mo7JKKItNIlboiK_pMOZ48ojx76jo3g,1046
1
+ cardo_python_utils-0.5.dev46.dist-info/licenses/LICENSE,sha256=N-YtxDy8n5A1Mo7JKKItNIlboiK_pMOZ48ojx76jo3g,1046
2
2
  python_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  python_utils/choices.py,sha256=_sLNkSnQqhg55gGKNRsOQCJ75W6gnz8J8Q00528MEYk,2548
4
4
  python_utils/data_structures.py,sha256=ZqkZYPy20zyGYOVhwb9qst4vF_P7X2A9z5E36rMUC6I,16820
@@ -11,9 +11,9 @@ python_utils/math.py,sha256=p_v8a9nVSe9426nR8H_SM8hOQrkzESVpCnn3gntw7TA,5603
11
11
  python_utils/text.py,sha256=pw9CZeM_Lcw-6k4GyR-4D1Wix8A7F_V1u1IIZTIazW4,3792
12
12
  python_utils/time.py,sha256=7Wei3uJ02Bk-BFRf-e1axoG418XQOhrXPvTwNZgTdnw,9614
13
13
  python_utils/types_hinting.py,sha256=QVWzmXRgNxhvln14tEX_FbQYryuVYhjWJ0dVOnlF6G4,120
14
- python_utils/django/README.md,sha256=01QcXWGfWcVaI2fFxcC2twYOabTCmTwh-OyyKPtcOdM,6027
14
+ python_utils/django/README.md,sha256=9MgmJQhl13hzp34j_CTsq3BzEWP8OPEcrYZW2ae4zF8,6062
15
15
  python_utils/django/__init__.py,sha256=uXyqF-_5gZAlSIKoQkUTedAeBjnUHqh6lR6SzA1DEOM,64
16
- python_utils/django/apps.py,sha256=rgGdSsvptNVQ5QOEfYTdX7eA9EBgEPqq3LKIBLxaFLo,103
16
+ python_utils/django/apps.py,sha256=vH2Ov8XgavTGKFLSjbH1kvuG7RWQCjeJepw6BSp2o3E,126
17
17
  python_utils/django/oidc_settings.py,sha256=EQlZeJrYy0c5X2Q3jmr4XEUm6HOUZqeKPFeM1HwKHbM,4330
18
18
  python_utils/django/settings.py,sha256=dbu4QPvG8N_z7P8eisEgI4qNwy2T8ZPNDkx9FoK4FEs,624
19
19
  python_utils/django/tenant_context.py,sha256=9LN15__PGhajy7raK382vVx8r5k90VUwUZJS4ylW0yA,3231
@@ -32,6 +32,7 @@ python_utils/django/celery/__init__.py,sha256=eqKpBqhClH-7oK-kD1SUEpzt4Gqu7VWLWm
32
32
  python_utils/django/celery/tenant_aware_database_scheduler.py,sha256=Qcz8mFhfFcX8Opzb75qvuF9jxwuY8Nsn0gxIBKFaU8w,8087
33
33
  python_utils/django/celery/tenant_aware_task.py,sha256=pKKuLczhI-1N5-ccFPeB1YV-n8Uu8LVOAvPVrB1zHeU,1316
34
34
  python_utils/django/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
+ python_utils/django/db/alias.py,sha256=sybxhZsShJdnz13hqEyYLxuaRert9zpRPPi-bAayyM4,574
35
36
  python_utils/django/db/routers.py,sha256=Q4YAvr37wgEgL04miPKSREhzFB5LDZrXulqStbqBZeA,252
36
37
  python_utils/django/db/transaction.py,sha256=0d4Yn98qxjn1LOJfaOTsd5qpPqB2fCqxsqG16StfcSg,921
37
38
  python_utils/django/db/utils.py,sha256=DMrFHTjXOkeDsUTdYOCAnZOU_PHKh0zvx-WXsyn7Z-A,2029
@@ -42,10 +43,17 @@ python_utils/django/management/commands/tenant_aware_command.py,sha256=MBI7N0BEH
42
43
  python_utils/django/middleware/__init__.py,sha256=GyhuzaOtaXW13iB9GL0XF7OvEEzKoJzorJzYX597idA,117
43
44
  python_utils/django/middleware/tenant_aware_http_middleware.py,sha256=W8U3-nR90b8m_wz5xDJTuImUrPEXvESzYh3VITYMIJU,3825
44
45
  python_utils/django/middleware/tenant_aware_websocket_middleware.py,sha256=k6bn4pS4uZcTPafF7Yz_8VAj0vchEfJSXM4Bxb-Od-k,4100
45
- python_utils/django/migrations/0001_initial.py,sha256=6w2eUrLlg9mtqHpvauh7V4lZx_kqV7d4GZKKCXf_8ZU,6660
46
+ python_utils/django/migrations/0001_initial.py,sha256=fLP4gJgVZRx5heFqNTVTf0h2dHVeIIyOxQn37kNpfUY,4340
47
+ python_utils/django/migrations/0001_initial_squashed_0005_alter_userrole_id.py,sha256=JZsoon-pZLwIzAy-3SnGzkVxa9eqPkP9QBSQsqPiJVo,6133
48
+ python_utils/django/migrations/0002_auto_20220120_1617.py,sha256=TOTmFU8wejKOX-bjq4D1s3B-QXTEub_FOX4STWAcJ4o,378
49
+ python_utils/django/migrations/0003_auto_20220513_1025.py,sha256=j4usfLINqTdSHSvWBnEUd4cxvHXqL8rRIw_FFna1Hn4,390
50
+ python_utils/django/migrations/0004_auto_20220817_1526.py,sha256=nS_nnQJabst0Eigt4Ry05RrG_lSM8WdWhRZ0iIX4tZY,579
51
+ python_utils/django/migrations/0005_alter_userrole_id.py,sha256=fWbqJw8ryCBtnJvqM-O_RDpQi6GFJHnwfyZOs0EKH3k,446
52
+ python_utils/django/migrations/0006_userrole_organization_and_more.py,sha256=EJE6wqmUS4qbcCwhjU11ZJXcRDDNZ3rjPqE8XbqZt8E,1270
53
+ python_utils/django/migrations/0007_user_demo.py,sha256=sqMrC1cxh0sDVixUeC9CQsWi9EZVbWrCat1AUfCQ6nA,396
46
54
  python_utils/django/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
- python_utils/django/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
- python_utils/django/models/user.py,sha256=TJApUZiWYLZo33b8GJXUu9qS4RxHQMOOxSy8rmxNHzU,853
55
+ python_utils/django/models/__init__.py,sha256=l9ueTdsKVif6Ufh5a4ikcgFWncsnPbMtfbjgg5G660o,43
56
+ python_utils/django/models/user.py,sha256=mPZBm9uIif1aCWkoYSqwaP7MQBhOmBLL55CfXasL74Q,801
49
57
  python_utils/django/models/user_group.py,sha256=WU_KClfj-pboDIKUDHZQfQuhAPIPXgP-LrEvg9XJjmA,504
50
58
  python_utils/django/redis/__init__.py,sha256=upioQc5-PwmdB9FB4or4C3RnCCxsrOIUrA3iTvo-tk8,86
51
59
  python_utils/django/redis/key_function.py,sha256=FkpRvg4Q7td8xZxYHPyo3lthXLzorD6GG8Qwne9H0kA,172
@@ -53,7 +61,7 @@ python_utils/django/storage/__init__.py,sha256=mNn2YmD7pkXhBLHMM1444BLsCMq78YdYx
53
61
  python_utils/django/storage/tenant_aware_storage.py,sha256=5dDes6xLv7_R8hIBbFIzRvPL7HL9K_RM-G6LI8qUSxM,2550
54
62
  python_utils/django/tests/__init__.py,sha256=Nkt0a7LEHyjLvuEBZ7113VjjAWJlyZlMy-H-JZ5tNcs,252
55
63
  python_utils/django/tests/conftest.py,sha256=KozXmXUWVcDLbkVAb7Aq4sDydGLh2YZkbRa4tkA8Z6U,3167
56
- cardo_python_utils-0.5.dev45.dist-info/METADATA,sha256=Mf4PqleUEihliYgsG_dD4NjR4Grb37Y1m14VxEmwUzg,3007
57
- cardo_python_utils-0.5.dev45.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
58
- cardo_python_utils-0.5.dev45.dist-info/top_level.txt,sha256=zAx6OfEsjJs8BEW3okSiG_j9gpkI69xWShzum6oBgKI,13
59
- cardo_python_utils-0.5.dev45.dist-info/RECORD,,
64
+ cardo_python_utils-0.5.dev46.dist-info/METADATA,sha256=1XWHcADAgQe3WKw1I9NJGI4WjFou8wGSk5jUOTC-H7c,3007
65
+ cardo_python_utils-0.5.dev46.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
66
+ cardo_python_utils-0.5.dev46.dist-info/top_level.txt,sha256=zAx6OfEsjJs8BEW3okSiG_j9gpkI69xWShzum6oBgKI,13
67
+ cardo_python_utils-0.5.dev46.dist-info/RECORD,,
@@ -33,6 +33,8 @@ MIDDLEWARE = [
33
33
  ...
34
34
  ]
35
35
 
36
+ AUTH_USER_MODEL = "idp_user.User"
37
+
36
38
  # Include the database configuration for each tenant in the DATABASES setting.
37
39
  # You can use the get_database_configs() function from python_utils.django.db.utils as a helper.
38
40
  from python_utils.django.db.utils import get_database_configs
@@ -3,3 +3,4 @@ from django.apps import AppConfig
3
3
 
4
4
  class DjangoAppConfig(AppConfig):
5
5
  name = "python_utils.django"
6
+ label = "idp_user"
@@ -0,0 +1,22 @@
1
+ from ..tenant_context import TenantContext
2
+
3
+
4
+ class DynamicDatabaseAlias(str):
5
+ def __new__(cls):
6
+ # We initialize with a dummy value; the logic happens in the methods below
7
+ return super().__new__(cls, "default")
8
+
9
+ def __getattribute__(self, name):
10
+ return getattr(TenantContext.get(), name)
11
+
12
+ def __str__(self):
13
+ return TenantContext.get()
14
+
15
+ def __repr__(self):
16
+ return repr(self.__str__())
17
+
18
+ def __hash__(self):
19
+ return hash(self.__str__())
20
+
21
+ def __eq__(self, other):
22
+ return self.__str__() == str(other)
@@ -1,6 +1,9 @@
1
+ # Generated by Django 3.1.13 on 2021-10-26 09:12
2
+
1
3
  import django.contrib.auth.models
2
4
  import django.contrib.auth.validators
3
5
  import django.utils.timezone
6
+ from django.conf import settings
4
7
  from django.db import migrations, models
5
8
 
6
9
 
@@ -8,147 +11,63 @@ class Migration(migrations.Migration):
8
11
  initial = True
9
12
 
10
13
  dependencies = [
11
- ("auth", "0012_alter_user_first_name_max_length"),
14
+ ('auth', '0012_alter_user_first_name_max_length'),
12
15
  ]
13
16
 
14
17
  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
- ),
18
+ migrations.CreateModel(
19
+ name='User',
20
+ fields=[
21
+ ('password', models.CharField(max_length=128, verbose_name='password')),
22
+ ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
23
+ ('is_superuser', models.BooleanField(default=False,
24
+ help_text='Designates that this user has all permissions without explicitly assigning them.',
25
+ verbose_name='superuser status')),
26
+ ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'},
27
+ help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
28
+ max_length=150, unique=True,
29
+ validators=[django.contrib.auth.validators.UnicodeUsernameValidator()],
30
+ verbose_name='username')),
31
+ ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
32
+ ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
33
+ ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
34
+ ('is_staff', models.BooleanField(default=False,
35
+ help_text='Designates whether the user can log into this admin site.',
36
+ verbose_name='staff status')),
37
+ ('is_active', models.BooleanField(default=True,
38
+ help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
39
+ verbose_name='active')),
40
+ ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
41
+ ('idp_user_id', models.BigIntegerField(primary_key=True, serialize=False)),
42
+ ('groups', models.ManyToManyField(blank=True,
43
+ help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.',
44
+ related_name='user_set', related_query_name='user', to='auth.Group',
45
+ verbose_name='groups')),
46
+ ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.',
47
+ related_name='user_set', related_query_name='user',
48
+ to='auth.Permission', verbose_name='user permissions')),
142
49
  ],
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
- ),
50
+ options={
51
+ 'verbose_name': 'user',
52
+ 'verbose_name_plural': 'users',
53
+ 'abstract': False,
54
+ },
55
+ managers=[
56
+ ('objects', django.contrib.auth.models.UserManager()),
148
57
  ],
149
58
  ),
150
- migrations.RunSQL(
151
- sql="DROP TABLE IF EXISTS idp_user_userrole CASCADE;",
152
- reverse_sql=migrations.RunSQL.noop,
59
+ migrations.CreateModel(
60
+ name='UserRole',
61
+ fields=[
62
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
63
+ ('role', models.CharField(max_length=125)),
64
+ ('app_config', models.JSONField(null=True)),
65
+ ('permission_restrictions', models.JSONField(default=dict)),
66
+ ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_roles',
67
+ to=settings.AUTH_USER_MODEL)),
68
+ ],
69
+ options={
70
+ 'unique_together': {('user', 'role')},
71
+ },
153
72
  ),
154
73
  ]
@@ -0,0 +1,167 @@
1
+ # Generated by Django 4.2 on 2023-04-16 23:27
2
+
3
+ import django.contrib.auth.models
4
+ import django.contrib.auth.validators
5
+ import django.db.models.deletion
6
+ import django.utils.timezone
7
+ from django.conf import settings
8
+ from django.db import migrations, models
9
+
10
+
11
+ class Migration(migrations.Migration):
12
+ replaces = [
13
+ ("idp_user", "0001_initial"),
14
+ ("idp_user", "0002_auto_20220120_1617"),
15
+ ("idp_user", "0003_auto_20220513_1025"),
16
+ ("idp_user", "0004_auto_20220817_1526"),
17
+ ("idp_user", "0005_alter_userrole_id"),
18
+ ]
19
+
20
+ dependencies = [
21
+ ("auth", "0012_alter_user_first_name_max_length"),
22
+ ]
23
+
24
+ operations = [
25
+ migrations.CreateModel(
26
+ name="User",
27
+ fields=[
28
+ ("password", models.CharField(max_length=128, verbose_name="password")),
29
+ (
30
+ "last_login",
31
+ models.DateTimeField(
32
+ blank=True, null=True, verbose_name="last login"
33
+ ),
34
+ ),
35
+ (
36
+ "is_superuser",
37
+ models.BooleanField(
38
+ default=False,
39
+ help_text="Designates that this user has all permissions without explicitly assigning them.",
40
+ verbose_name="superuser status",
41
+ ),
42
+ ),
43
+ (
44
+ "username",
45
+ models.CharField(
46
+ error_messages={
47
+ "unique": "A user with that username already exists."
48
+ },
49
+ help_text="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
50
+ max_length=150,
51
+ unique=True,
52
+ validators=[
53
+ django.contrib.auth.validators.UnicodeUsernameValidator()
54
+ ],
55
+ verbose_name="username",
56
+ ),
57
+ ),
58
+ (
59
+ "first_name",
60
+ models.CharField(
61
+ blank=True, max_length=150, verbose_name="first name"
62
+ ),
63
+ ),
64
+ (
65
+ "last_name",
66
+ models.CharField(
67
+ blank=True, max_length=150, verbose_name="last name"
68
+ ),
69
+ ),
70
+ (
71
+ "email",
72
+ models.EmailField(
73
+ blank=True, max_length=254, verbose_name="email address"
74
+ ),
75
+ ),
76
+ (
77
+ "is_staff",
78
+ models.BooleanField(
79
+ default=False,
80
+ help_text="Designates whether the user can log into this admin site.",
81
+ verbose_name="staff status",
82
+ ),
83
+ ),
84
+ (
85
+ "is_active",
86
+ models.BooleanField(
87
+ default=True,
88
+ help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
89
+ verbose_name="active",
90
+ ),
91
+ ),
92
+ (
93
+ "date_joined",
94
+ models.DateTimeField(
95
+ default=django.utils.timezone.now, verbose_name="date joined"
96
+ ),
97
+ ),
98
+ (
99
+ "id",
100
+ models.BigAutoField(
101
+ auto_created=True,
102
+ primary_key=True,
103
+ serialize=False,
104
+ verbose_name="ID",
105
+ ),
106
+ ),
107
+ (
108
+ "groups",
109
+ models.ManyToManyField(
110
+ blank=True,
111
+ help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.",
112
+ related_name="user_set",
113
+ related_query_name="user",
114
+ to="auth.group",
115
+ verbose_name="groups",
116
+ ),
117
+ ),
118
+ (
119
+ "user_permissions",
120
+ models.ManyToManyField(
121
+ blank=True,
122
+ help_text="Specific permissions for this user.",
123
+ related_name="user_set",
124
+ related_query_name="user",
125
+ to="auth.permission",
126
+ verbose_name="user permissions",
127
+ ),
128
+ ),
129
+ ],
130
+ options={
131
+ "verbose_name": "user",
132
+ "verbose_name_plural": "users",
133
+ "abstract": False,
134
+ },
135
+ managers=[
136
+ ("objects", django.contrib.auth.models.UserManager()),
137
+ ],
138
+ ),
139
+ migrations.CreateModel(
140
+ name="UserRole",
141
+ fields=[
142
+ (
143
+ "id",
144
+ models.BigAutoField(
145
+ auto_created=True,
146
+ primary_key=True,
147
+ serialize=False,
148
+ verbose_name="ID",
149
+ ),
150
+ ),
151
+ ("role", models.CharField(max_length=140)),
152
+ ("app_entities_restrictions", models.JSONField(null=True)),
153
+ ("permission_restrictions", models.JSONField(default=dict)),
154
+ (
155
+ "user",
156
+ models.ForeignKey(
157
+ on_delete=django.db.models.deletion.CASCADE,
158
+ related_name="user_roles",
159
+ to=settings.AUTH_USER_MODEL,
160
+ ),
161
+ ),
162
+ ],
163
+ options={
164
+ "unique_together": {("user", "role")},
165
+ },
166
+ ),
167
+ ]
@@ -0,0 +1,18 @@
1
+ # Generated by Django 3.1.14 on 2022-01-20 16:17
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('idp_user', '0001_initial'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterField(
14
+ model_name='userrole',
15
+ name='role',
16
+ field=models.CharField(max_length=140),
17
+ ),
18
+ ]
@@ -0,0 +1,18 @@
1
+ # Generated by Django 3.1.14 on 2022-05-13 10:25
2
+
3
+ from django.db import migrations
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('idp_user', '0002_auto_20220120_1617'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.RenameField(
14
+ model_name='userrole',
15
+ old_name='app_config',
16
+ new_name='app_entities_restrictions',
17
+ ),
18
+ ]
@@ -0,0 +1,23 @@
1
+ # Generated by Django 4.0.6 on 2022-08-17 15:26
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('idp_user', '0003_auto_20220513_1025'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.RenameField(
14
+ model_name='user',
15
+ old_name='idp_user_id',
16
+ new_name='id',
17
+ ),
18
+ migrations.AlterField(
19
+ model_name='user',
20
+ name='id',
21
+ field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
22
+ ),
23
+ ]
@@ -0,0 +1,18 @@
1
+ # Generated by Django 4.0.6 on 2022-08-18 10:03
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('idp_user', '0004_auto_20220817_1526'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterField(
14
+ model_name='userrole',
15
+ name='id',
16
+ field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
17
+ ),
18
+ ]
@@ -0,0 +1,31 @@
1
+ # Generated by Django 5.0.2 on 2024-03-19 08:54
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+ dependencies = [
8
+ ('idp_user', '0001_initial_squashed_0005_alter_userrole_id'),
9
+ ]
10
+
11
+ operations = [
12
+ migrations.AddField(
13
+ model_name='userrole',
14
+ name='organization',
15
+ field=models.CharField(help_text='The name of the organization the user role belongs to, if any.',
16
+ max_length=140, null=True),
17
+ ),
18
+ migrations.AlterField(
19
+ model_name='userrole',
20
+ name='app_entities_restrictions',
21
+ field=models.JSONField(
22
+ help_text='This dictionary contains explicit restrictions about the app entities that the user can access, in the form: {<entity_type>: [1, 2]}',
23
+ null=True),
24
+ ),
25
+ migrations.AlterField(
26
+ model_name='userrole',
27
+ name='permission_restrictions',
28
+ field=models.JSONField(default=dict,
29
+ help_text="This dictionary contains explicit restrictions regarding app permissions, in the form: {'perform_operation_1': {'entity_type': [1, 2]}, 'perform_operation_2': false}"),
30
+ ),
31
+ ]
@@ -0,0 +1,15 @@
1
+ from django.db import migrations, models
2
+
3
+
4
+ class Migration(migrations.Migration):
5
+ dependencies = [
6
+ ('idp_user', '0006_userrole_organization_and_more'),
7
+ ]
8
+
9
+ operations = [
10
+ migrations.AddField(
11
+ model_name='user',
12
+ name='is_demo',
13
+ field=models.BooleanField(default=False, help_text='Whether this user is a demo user.'),
14
+ ),
15
+ ]
@@ -0,0 +1,3 @@
1
+ from .user import User
2
+
3
+ __all__ = ["User"]
@@ -20,6 +20,3 @@ class User(AbstractUser):
20
20
  related_name="idp_user_set",
21
21
  related_query_name="user",
22
22
  )
23
-
24
- class Meta:
25
- db_table = "idp_user_user"