django-spire 0.19.3__py3-none-any.whl → 0.19.4__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.
- django_spire/consts.py +1 -1
- django_spire/core/management/commands/spire_startapp_pkg/maps.py +14 -7
- django_spire/core/management/commands/spire_startapp_pkg/user_input.py +10 -7
- django_spire/core/static/django_spire/css/app-navigation.css +4 -0
- django_spire/core/templatetags/spire_core_tags.py +11 -0
- {django_spire-0.19.3.dist-info → django_spire-0.19.4.dist-info}/METADATA +1 -1
- {django_spire-0.19.3.dist-info → django_spire-0.19.4.dist-info}/RECORD +10 -10
- {django_spire-0.19.3.dist-info → django_spire-0.19.4.dist-info}/WHEEL +0 -0
- {django_spire-0.19.3.dist-info → django_spire-0.19.4.dist-info}/licenses/LICENSE.md +0 -0
- {django_spire-0.19.3.dist-info → django_spire-0.19.4.dist-info}/top_level.txt +0 -0
django_spire/consts.py
CHANGED
|
@@ -29,6 +29,7 @@ class AppConfiguration:
|
|
|
29
29
|
components: list[str],
|
|
30
30
|
user_inputs: dict[str, str] | None = None
|
|
31
31
|
) -> AppConfiguration:
|
|
32
|
+
immediate_parent = components[-2] if len(components) > 2 else None
|
|
32
33
|
parent_parts = components[1:-1] if len(components) > 1 else []
|
|
33
34
|
|
|
34
35
|
app_name = (
|
|
@@ -49,8 +50,8 @@ class AppConfiguration:
|
|
|
49
50
|
)
|
|
50
51
|
|
|
51
52
|
default_label = (
|
|
52
|
-
|
|
53
|
-
if
|
|
53
|
+
immediate_parent.lower() + '_' + app_name.lower()
|
|
54
|
+
if immediate_parent
|
|
54
55
|
else app_name.lower()
|
|
55
56
|
)
|
|
56
57
|
|
|
@@ -60,10 +61,16 @@ class AppConfiguration:
|
|
|
60
61
|
else default_label
|
|
61
62
|
)
|
|
62
63
|
|
|
64
|
+
default_db_table = (
|
|
65
|
+
'_'.join(parent_parts).lower() + '_' + app_name.lower()
|
|
66
|
+
if parent_parts
|
|
67
|
+
else app_name.lower()
|
|
68
|
+
)
|
|
69
|
+
|
|
63
70
|
db_table = (
|
|
64
|
-
user_inputs.get('db_table_name',
|
|
71
|
+
user_inputs.get('db_table_name', default_db_table)
|
|
65
72
|
if user_inputs
|
|
66
|
-
else
|
|
73
|
+
else default_db_table
|
|
67
74
|
)
|
|
68
75
|
|
|
69
76
|
inherit_permissions = (
|
|
@@ -324,7 +331,7 @@ class ModelPermissions:
|
|
|
324
331
|
user_inputs: dict[str, str] | None = None
|
|
325
332
|
) -> ModelPermissions:
|
|
326
333
|
module = '.'.join(components)
|
|
327
|
-
|
|
334
|
+
immediate_parent = components[-2] if len(components) > 2 else None
|
|
328
335
|
|
|
329
336
|
app_name = (
|
|
330
337
|
user_inputs.get('app_name', components[-1])
|
|
@@ -344,8 +351,8 @@ class ModelPermissions:
|
|
|
344
351
|
)
|
|
345
352
|
|
|
346
353
|
default_permission_name = (
|
|
347
|
-
|
|
348
|
-
if
|
|
354
|
+
immediate_parent.lower() + '_' + app_name.lower()
|
|
355
|
+
if immediate_parent
|
|
349
356
|
else app_name.lower()
|
|
350
357
|
)
|
|
351
358
|
|
|
@@ -49,7 +49,7 @@ class UserInputCollector:
|
|
|
49
49
|
app_label = self._collect_app_label(components, app_name)
|
|
50
50
|
model_name = self._collect_model_name(app_name)
|
|
51
51
|
model_name_plural = self._collect_model_name_plural(model_name)
|
|
52
|
-
db_table_name = self._collect_db_table_name(app_label
|
|
52
|
+
db_table_name = self._collect_db_table_name(components, app_name) # Changed from app_label to components, app_name
|
|
53
53
|
model_permission_path = self._collect_model_permission_path(app_path, model_name)
|
|
54
54
|
|
|
55
55
|
permission_data = self._collect_permission_inheritance(components)
|
|
@@ -78,8 +78,8 @@ class UserInputCollector:
|
|
|
78
78
|
:return: User-provided or default app label.
|
|
79
79
|
"""
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
default =
|
|
81
|
+
immediate_parent = components[-2] if len(components) > 2 else None
|
|
82
|
+
default = immediate_parent.lower() + '_' + app_name.lower() if immediate_parent else app_name.lower()
|
|
83
83
|
return self._collect_input('Enter the app label', default, '3/8')
|
|
84
84
|
|
|
85
85
|
def _collect_app_name(self, components: list[str]) -> str:
|
|
@@ -114,15 +114,18 @@ class UserInputCollector:
|
|
|
114
114
|
|
|
115
115
|
return app_path
|
|
116
116
|
|
|
117
|
-
def _collect_db_table_name(self,
|
|
117
|
+
def _collect_db_table_name(self, components: list[str], app_name: str) -> str:
|
|
118
118
|
"""
|
|
119
119
|
Prompts the user for the database table name.
|
|
120
120
|
|
|
121
|
-
:param
|
|
121
|
+
:param components: List of app path components.
|
|
122
|
+
:param app_name: Name of the app.
|
|
122
123
|
:return: User-provided or default database table name.
|
|
123
124
|
"""
|
|
124
125
|
|
|
125
|
-
|
|
126
|
+
parent_parts = components[1:-1] if len(components) > 1 else []
|
|
127
|
+
default = '_'.join(parent_parts).lower() + '_' + app_name.lower() if parent_parts else app_name.lower()
|
|
128
|
+
return self._collect_input('Enter the database table name', default, '6/8')
|
|
126
129
|
|
|
127
130
|
def _collect_input(self, prompt: str, default: str, step_number: str) -> str:
|
|
128
131
|
"""
|
|
@@ -183,7 +186,7 @@ class UserInputCollector:
|
|
|
183
186
|
:return: Dictionary containing permission inheritance settings.
|
|
184
187
|
"""
|
|
185
188
|
|
|
186
|
-
if len(components) <=
|
|
189
|
+
if len(components) <= 1:
|
|
187
190
|
return {'inherit_permissions': False, 'parent_permission_prefix': '', 'parent_model_instance_name': ''}
|
|
188
191
|
|
|
189
192
|
if not self._should_inherit_permissions():
|
|
@@ -73,6 +73,10 @@
|
|
|
73
73
|
transition: background-color 0.2s ease, color 0.2s ease;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
.side-navigation a.active {
|
|
77
|
+
color: var(--app-side-navigation-link-color) !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
76
80
|
.side-navigation a:hover {
|
|
77
81
|
color: var(--app-side-navigation-link-hover-color) !important;
|
|
78
82
|
}
|
|
@@ -79,6 +79,17 @@ def index(indexable: Sequence[U], index_value: int) -> U | Sequence[U]:
|
|
|
79
79
|
return indexable
|
|
80
80
|
|
|
81
81
|
|
|
82
|
+
@register.filter(name='is_path')
|
|
83
|
+
def is_path(current: str, url: str) -> bool:
|
|
84
|
+
if not current or not url:
|
|
85
|
+
return False
|
|
86
|
+
|
|
87
|
+
if current == url:
|
|
88
|
+
return True
|
|
89
|
+
|
|
90
|
+
return url != '/' and current.startswith(url)
|
|
91
|
+
|
|
92
|
+
|
|
82
93
|
@register.simple_tag()
|
|
83
94
|
def generate_id() -> str:
|
|
84
95
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: django-spire
|
|
3
|
-
Version: 0.19.
|
|
3
|
+
Version: 0.19.4
|
|
4
4
|
Summary: A project for Django Spire
|
|
5
5
|
Author-email: Brayden Carlson <braydenc@stratusadv.com>, Nathan Johnson <nathanj@stratusadv.com>
|
|
6
6
|
License: Copyright (c) 2024 Stratus Advanced Technologies and Contributors.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
django_spire/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
django_spire/conf.py,sha256=c5Hs-7lk9T15254tOasiQ2ZTFLQIVJof9_QJDfm1PAI,933
|
|
3
|
-
django_spire/consts.py,sha256=
|
|
3
|
+
django_spire/consts.py,sha256=MtDZv4mhMaz4wgBAinDZk6VFo5x5VSTHfVNEwz0GQDE,171
|
|
4
4
|
django_spire/exceptions.py,sha256=L5ndRO5ftMmh0pHkO2z_NG3LSGZviJ-dDHNT73SzTNw,48
|
|
5
5
|
django_spire/settings.py,sha256=_bM5uUqJXq3sW-NZBNAzt4egZwmvLq_jA8DaQGHqVoE,661
|
|
6
6
|
django_spire/urls.py,sha256=mKeZszb5U4iIGqddMb5Tt5fRC72U2wABEOi6mvOfEBU,656
|
|
@@ -434,13 +434,13 @@ django_spire/core/management/commands/spire_startapp_pkg/builder.py,sha256=gb401
|
|
|
434
434
|
django_spire/core/management/commands/spire_startapp_pkg/config.py,sha256=yBtlIcyoK0MFpgP8izB6yzX9jWQIenQ_5D62kYM2D3o,3372
|
|
435
435
|
django_spire/core/management/commands/spire_startapp_pkg/filesystem.py,sha256=TjZZGKqVGrTRr37rWxc0vCcUsviV28DcNCZ2Fo5yz80,3020
|
|
436
436
|
django_spire/core/management/commands/spire_startapp_pkg/generator.py,sha256=JEU8-TstU2hiS_zBegWGFuCZ_lyf7P4iedx3hcX2BLA,5915
|
|
437
|
-
django_spire/core/management/commands/spire_startapp_pkg/maps.py,sha256=
|
|
437
|
+
django_spire/core/management/commands/spire_startapp_pkg/maps.py,sha256=ekgvis2eAhYVQp19F5vM3IS0r0kbts4aPHbJs14c0wE,23228
|
|
438
438
|
django_spire/core/management/commands/spire_startapp_pkg/permissions.py,sha256=czSE-ZNBw-3LsGrtkaD7CBFnitYX18KQjgJ_jjbap7k,5260
|
|
439
439
|
django_spire/core/management/commands/spire_startapp_pkg/processor.py,sha256=zQhuIn2EPU6h-75DrVX8mZOZIBzc5F8GKds8m83QGiA,5900
|
|
440
440
|
django_spire/core/management/commands/spire_startapp_pkg/registry.py,sha256=olBBFvDir6-zOoltQRIzHNIWkRG6CnA1FcP80tU7S3s,2185
|
|
441
441
|
django_spire/core/management/commands/spire_startapp_pkg/reporter.py,sha256=CS8cufg6kQq48A5fO4qIdUNDZWsCriHaW_wqQhzlqUc,10062
|
|
442
442
|
django_spire/core/management/commands/spire_startapp_pkg/resolver.py,sha256=loVIG8zCN_Bo6vjBV2UsUF930Rc5SG5P2klJl3qp0pc,2331
|
|
443
|
-
django_spire/core/management/commands/spire_startapp_pkg/user_input.py,sha256=
|
|
443
|
+
django_spire/core/management/commands/spire_startapp_pkg/user_input.py,sha256=sj8o-BZw1GMFGRHE91SIG4dODVlJp2_uMXweWcHJb1M,9827
|
|
444
444
|
django_spire/core/management/commands/spire_startapp_pkg/validator.py,sha256=q6fsyRmR1kcN2eAFu-5pDaadJ05FDog7N23eR215Yx0,3322
|
|
445
445
|
django_spire/core/management/commands/spire_startapp_pkg/template/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
446
446
|
django_spire/core/management/commands/spire_startapp_pkg/template/app/__init__.py.template,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -503,7 +503,7 @@ django_spire/core/static/django_spire/css/app-button.css,sha256=iUPOFgXp2v_gsNBe
|
|
|
503
503
|
django_spire/core/static/django_spire/css/app-default.css,sha256=RLVP_vLlkNx_UpNmMmgO73R3UUB_h3sVHt8I2z_iPVk,315
|
|
504
504
|
django_spire/core/static/django_spire/css/app-import.css,sha256=5jCOcsnTYJsz_pcopA9ssl4nTsBvysjNIH6RVdz1qhU,385
|
|
505
505
|
django_spire/core/static/django_spire/css/app-layout.css,sha256=Wwnbf3tJ3khvTAC2DgzXPtgfR3rWyfMzQ1wljCNsOLo,458
|
|
506
|
-
django_spire/core/static/django_spire/css/app-navigation.css,sha256=
|
|
506
|
+
django_spire/core/static/django_spire/css/app-navigation.css,sha256=_yQ7JCIOoHyOhfpTkj8Q07ma0dFvOMHXTHetnT8-27I,2587
|
|
507
507
|
django_spire/core/static/django_spire/css/app-offcanvas.css,sha256=SxDsONE1eqERJ1gDAP8chjoJ0aD0Q1VHBPqRWJi8-Mw,178
|
|
508
508
|
django_spire/core/static/django_spire/css/app-page.css,sha256=pB-sSZc9NEUkkMcCfzzrCfeiggGmhONn8Eid5HLs8c0,363
|
|
509
509
|
django_spire/core/static/django_spire/css/app-side-panel.css,sha256=ltggQkEc9tswJ9g2M0qzmWprdzycvizrS0YgY2We2U0,1954
|
|
@@ -682,7 +682,7 @@ django_spire/core/templates/django_spire/wizard/wizard_page.html,sha256=emW5W2z_
|
|
|
682
682
|
django_spire/core/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
683
683
|
django_spire/core/templatetags/json.py,sha256=2XY8hQZrJOSmGMblL8bLRYD9hvUSQvhYaSJvwGaKzwU,280
|
|
684
684
|
django_spire/core/templatetags/message.py,sha256=y70pMv1ddttJ41c11O1S7h7v8h_gTtJVdXe67J4Ld3g,491
|
|
685
|
-
django_spire/core/templatetags/spire_core_tags.py,sha256=
|
|
685
|
+
django_spire/core/templatetags/spire_core_tags.py,sha256=_IN6HWrscCKJ8LjDRe47y5g1kvBgDAQ7tNAuD5SiuEY,4247
|
|
686
686
|
django_spire/core/templatetags/string_formating.py,sha256=pE5ID0-cvOKfmbAIixVXEW3LN8_XLEF_OlpztHkiILk,444
|
|
687
687
|
django_spire/core/templatetags/variable_types.py,sha256=LFk9NO-LKBTBnXu04jLJ_miOKyuO-KAvqaBM8jwzg7s,686
|
|
688
688
|
django_spire/core/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -1132,8 +1132,8 @@ django_spire/theme/urls/page_urls.py,sha256=S8nkKkgbhG3XHI3uMUL-piOjXIrRkuY2UlM_
|
|
|
1132
1132
|
django_spire/theme/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1133
1133
|
django_spire/theme/views/json_views.py,sha256=W1khC2K_EMbEzAFmMxC_P76_MFnkRH4-eVdodrRfAhw,1904
|
|
1134
1134
|
django_spire/theme/views/page_views.py,sha256=pHr8iekjtR99xs7w1taj35HEo133Svq1dvDD0y0VL1c,3933
|
|
1135
|
-
django_spire-0.19.
|
|
1136
|
-
django_spire-0.19.
|
|
1137
|
-
django_spire-0.19.
|
|
1138
|
-
django_spire-0.19.
|
|
1139
|
-
django_spire-0.19.
|
|
1135
|
+
django_spire-0.19.4.dist-info/licenses/LICENSE.md,sha256=tlTbOtgKoy-xAQpUk9gPeh9O4oRXCOzoWdW3jJz0wnA,1091
|
|
1136
|
+
django_spire-0.19.4.dist-info/METADATA,sha256=1iX3c8liLNuaCp4euBri5oacEIyo1u4Jl44cn6aYh_E,4967
|
|
1137
|
+
django_spire-0.19.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
1138
|
+
django_spire-0.19.4.dist-info/top_level.txt,sha256=xf3QV1e--ONkVpgMDQE9iqjQ1Vg4--_6C8wmO-KxPHQ,13
|
|
1139
|
+
django_spire-0.19.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|