django-spire 0.23.0__py3-none-any.whl → 0.23.2__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/contrib/queryset/enums.py +2 -3
- django_spire/contrib/queryset/mixins.py +17 -6
- django_spire/contrib/session/controller.py +0 -1
- django_spire/core/templates/django_spire/infinite_scroll/scroll.html +6 -16
- {django_spire-0.23.0.dist-info → django_spire-0.23.2.dist-info}/METADATA +1 -1
- {django_spire-0.23.0.dist-info → django_spire-0.23.2.dist-info}/RECORD +10 -10
- {django_spire-0.23.0.dist-info → django_spire-0.23.2.dist-info}/WHEEL +0 -0
- {django_spire-0.23.0.dist-info → django_spire-0.23.2.dist-info}/licenses/LICENSE.md +0 -0
- {django_spire-0.23.0.dist-info → django_spire-0.23.2.dist-info}/top_level.txt +0 -0
django_spire/consts.py
CHANGED
|
@@ -22,24 +22,35 @@ class SessionFilterQuerySetMixin(QuerySet):
|
|
|
22
22
|
) -> QuerySet:
|
|
23
23
|
# Session keys must match to process new queryset data
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
try:
|
|
26
|
+
action = SessionFilterActionEnum(request.GET.get('action'))
|
|
27
|
+
except ValueError:
|
|
28
|
+
action = None
|
|
29
|
+
|
|
26
30
|
form = form_class(request.GET)
|
|
27
31
|
|
|
28
32
|
if form.is_valid():
|
|
29
33
|
session = SessionController(request=request, session_key=session_key)
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
if action == SessionFilterActionEnum.CLEAR.value:
|
|
35
|
+
if action == SessionFilterActionEnum.CLEAR:
|
|
33
36
|
session.purge()
|
|
34
37
|
return self
|
|
35
38
|
|
|
36
|
-
#
|
|
37
|
-
if
|
|
38
|
-
|
|
39
|
+
# Apply filters when the user submits the filter form
|
|
40
|
+
if (
|
|
41
|
+
action == SessionFilterActionEnum.FILTER
|
|
42
|
+
and session_key == request.GET.get('session_filter_key')
|
|
43
|
+
):
|
|
39
44
|
# Update session data
|
|
40
45
|
for key, value in form.cleaned_data.items():
|
|
41
46
|
session.add_data(key, value)
|
|
42
47
|
|
|
48
|
+
# If the session is expired, return the unfiltered queryset
|
|
49
|
+
if session.is_expired:
|
|
50
|
+
return self
|
|
51
|
+
|
|
52
|
+
# When no new filter data is applied and session is NOT yet expired,
|
|
53
|
+
# return the original queryset
|
|
43
54
|
return self.bulk_filter(session.data)
|
|
44
55
|
else:
|
|
45
56
|
show_form_errors(request, form)
|
|
@@ -66,7 +66,8 @@
|
|
|
66
66
|
batch_size: this.batch_size
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
let
|
|
69
|
+
let separator = this.endpoint.includes('?') ? '&' : '?';
|
|
70
|
+
let url = `${this.endpoint}${separator}${params}`;
|
|
70
71
|
let view = new ViewGlue(url, {});
|
|
71
72
|
|
|
72
73
|
let previous_count = this.loaded_count;
|
|
@@ -129,24 +130,13 @@
|
|
|
129
130
|
>
|
|
130
131
|
<div x-ref="content_container"></div>
|
|
131
132
|
|
|
132
|
-
<div
|
|
133
|
-
</div>
|
|
134
|
-
|
|
135
|
-
<template x-if="show_loading">
|
|
136
|
-
<div
|
|
137
|
-
class="position-absolute d-flex justify-content-center align-items-center"
|
|
138
|
-
style="top: 0; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--app-layer-one) 85%, transparent);"
|
|
139
|
-
>
|
|
133
|
+
<div x-cloak x-show="show_loading" class="py-3 text-center">
|
|
140
134
|
<div class="spinner-border text-app-primary" role="status"></div>
|
|
141
135
|
</div>
|
|
142
|
-
</template>
|
|
143
|
-
</div>
|
|
144
136
|
|
|
145
|
-
|
|
146
|
-
<div class="col text-start">
|
|
147
|
-
<span class="fs-7 text-app-secondary">
|
|
148
|
-
Showing <span x-text="loaded_count"></span> of <span x-text="total_count"></span> items
|
|
149
|
-
</span>
|
|
137
|
+
<div style="height: 10px;" x-ref="infinite_scroll_trigger"></div>
|
|
150
138
|
</div>
|
|
151
139
|
</div>
|
|
140
|
+
|
|
141
|
+
{% include 'django_spire/infinite_scroll/element/footer.html' %}
|
|
152
142
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: django-spire
|
|
3
|
-
Version: 0.23.
|
|
3
|
+
Version: 0.23.2
|
|
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=gvinNQud8bYSX-PURLRcfJBJmBVQWlEp4R7rxv9E_y0,171
|
|
4
4
|
django_spire/exceptions.py,sha256=L5ndRO5ftMmh0pHkO2z_NG3LSGZviJ-dDHNT73SzTNw,48
|
|
5
5
|
django_spire/settings.py,sha256=B4GPqBGt_dmkt0Ay0j-IP-SZ6mY44m2Ap5kVSON5YLA,1005
|
|
6
6
|
django_spire/urls.py,sha256=mKeZszb5U4iIGqddMb5Tt5fRC72U2wABEOi6mvOfEBU,656
|
|
@@ -355,9 +355,9 @@ django_spire/contrib/progress/static/django_spire/js/contrib/progress/progress.j
|
|
|
355
355
|
django_spire/contrib/progress/templates/django_spire/contrib/progress/card/card.html,sha256=2Ajv0UBJEGwc4InVe69aLe2u4K56yh2JAuvO6uH24j8,3353
|
|
356
356
|
django_spire/contrib/progress/templates/django_spire/contrib/progress/modal/content.html,sha256=oZ7mOxzro5809wSHLe4A90PonAqcr_eVawR_xHKXIt8,3682
|
|
357
357
|
django_spire/contrib/queryset/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
358
|
-
django_spire/contrib/queryset/enums.py,sha256=
|
|
358
|
+
django_spire/contrib/queryset/enums.py,sha256=nGUHwCVOCBfVXo-lrgyqRoEaMq0ZQAGOWnjALSFPjJU,108
|
|
359
359
|
django_spire/contrib/queryset/filter_tools.py,sha256=o7OBB3Jjtyoj7aaWspkFKS2bv0BeMIigXz7DVvt6Ueo,1087
|
|
360
|
-
django_spire/contrib/queryset/mixins.py,sha256=
|
|
360
|
+
django_spire/contrib/queryset/mixins.py,sha256=Y_tK9ECr1cb_7AywpNaFKmqxRmNzvNuSCDyqVmfNcCE,2096
|
|
361
361
|
django_spire/contrib/seeding/__init__.py,sha256=mHKO8a7fCAf70BWYjgyGgBDfssPtb3Pp9IxCVVI_4-M,112
|
|
362
362
|
django_spire/contrib/seeding/field/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
363
363
|
django_spire/contrib/seeding/field/base.py,sha256=SK8EYSsLgMRgosY8bRb3X27RpL7cq55VETf6Q_pYYr4,1198
|
|
@@ -409,7 +409,7 @@ django_spire/contrib/service/django_model_service.py,sha256=urQoEcrj2w3zxEILX0nr
|
|
|
409
409
|
django_spire/contrib/service/exceptions.py,sha256=cQZitr-CiSJ1Aeah3L4kNYcFcicCGMu5AQtEI3TwiUE,113
|
|
410
410
|
django_spire/contrib/session/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
411
411
|
django_spire/contrib/session/apps.py,sha256=e2lvkf3lZIFYMsgzsdIb97kP3TSYF8W2u26lb0qqZkw,221
|
|
412
|
-
django_spire/contrib/session/controller.py,sha256=
|
|
412
|
+
django_spire/contrib/session/controller.py,sha256=wXnBmoRz_HBOvsxjkndv76AEG7itmTwoXZq6LcwPjME,2926
|
|
413
413
|
django_spire/contrib/session/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
414
414
|
django_spire/contrib/session/templatetags/session_tags.py,sha256=wVlW5_d6AMsMWqCwCgX39r6nS5NS6vbl7hmi_ZrVKmg,459
|
|
415
415
|
django_spire/contrib/session/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -665,7 +665,7 @@ django_spire/core/templates/django_spire/forms/elements/list_element.html,sha256
|
|
|
665
665
|
django_spire/core/templates/django_spire/forms/elements/value_element.html,sha256=LaOR2ggmf-J_cPCVHjNoD4l_858zHCRA58T_ZB3EIkE,57
|
|
666
666
|
django_spire/core/templates/django_spire/forms/widgets/json_tree_widget.html,sha256=dykf6xYRZ477i6SgcGR3TSnxDwLsu2p3FR45hEr4DF8,1489
|
|
667
667
|
django_spire/core/templates/django_spire/infinite_scroll/base.html,sha256=x4JJgXTnWXTRz2laFHBW5jpD4D9sU-P8eAUDgEc3-UU,10875
|
|
668
|
-
django_spire/core/templates/django_spire/infinite_scroll/scroll.html,sha256=
|
|
668
|
+
django_spire/core/templates/django_spire/infinite_scroll/scroll.html,sha256=osZx9nsCypvnZY3dva_52MoZQRkLK0kOCMnGxHvhsUw,4311
|
|
669
669
|
django_spire/core/templates/django_spire/infinite_scroll/element/footer.html,sha256=22yxDuYB2vKqaDaMsARStrYTYoHtPGYmK6Xl9XQdwH8,391
|
|
670
670
|
django_spire/core/templates/django_spire/item/infinite_scroll_item.html,sha256=NMx3jQwtcKJiKtzbQXaXI3eWOtnJFiZhCI13tLTxSnc,1011
|
|
671
671
|
django_spire/core/templates/django_spire/item/item.html,sha256=9AD6qRcYIb7q-EcmWlRUFiK8XfnmPBSS5NOsXdKEAAA,1217
|
|
@@ -1193,8 +1193,8 @@ django_spire/theme/urls/page_urls.py,sha256=S8nkKkgbhG3XHI3uMUL-piOjXIrRkuY2UlM_
|
|
|
1193
1193
|
django_spire/theme/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1194
1194
|
django_spire/theme/views/json_views.py,sha256=PWwVTaty0BVGbj65L5cxex6JNhc-xVAI_rEYjbJWqEM,1893
|
|
1195
1195
|
django_spire/theme/views/page_views.py,sha256=WenjOa6Welpu3IMolY56ZwBjy4aK9hpbiMNuygjAl1A,3922
|
|
1196
|
-
django_spire-0.23.
|
|
1197
|
-
django_spire-0.23.
|
|
1198
|
-
django_spire-0.23.
|
|
1199
|
-
django_spire-0.23.
|
|
1200
|
-
django_spire-0.23.
|
|
1196
|
+
django_spire-0.23.2.dist-info/licenses/LICENSE.md,sha256=tlTbOtgKoy-xAQpUk9gPeh9O4oRXCOzoWdW3jJz0wnA,1091
|
|
1197
|
+
django_spire-0.23.2.dist-info/METADATA,sha256=7x2HFXnglT6gwdbs_JxDzGbWqwZIfxsT6p9dzDCh-AY,5127
|
|
1198
|
+
django_spire-0.23.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
1199
|
+
django_spire-0.23.2.dist-info/top_level.txt,sha256=xf3QV1e--ONkVpgMDQE9iqjQ1Vg4--_6C8wmO-KxPHQ,13
|
|
1200
|
+
django_spire-0.23.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|