accrete 0.0.130__py3-none-any.whl → 0.0.131__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.
@@ -8,3 +8,4 @@ from . context import (
8
8
  TableRowContext,
9
9
  ModalContext
10
10
  )
11
+ from .utils import update_modal
@@ -0,0 +1,17 @@
1
+ from django.http import HttpRequest, HttpResponse
2
+ from django.shortcuts import render
3
+ from .context import ModalContext
4
+
5
+
6
+ def update_modal(
7
+ request: HttpRequest,
8
+ template: str,
9
+ context: ModalContext | dict
10
+ ) -> HttpResponse:
11
+
12
+ if isinstance(context, ModalContext):
13
+ context = context.dict()
14
+ res = render(request, template, context)
15
+ res.headers['HX-Retarget'] = f'#{context["modal_id"]}'
16
+ res.headers['HX-Reswap'] = 'outerHTML'
17
+ return res
@@ -77,10 +77,7 @@ def user_change_password(request):
77
77
  + f'?{request.GET.urlencode()}'
78
78
  )
79
79
  ctx.update(form=form)
80
- res = render(request, 'user/change_password.html', ctx)
81
- res.headers['HX-Retarget'] = f'#{ctx["modal_id"]}'
82
- res.headers['HX-Reswap'] = 'outerHTML'
83
- return res
80
+ return ui.update_modal(request, 'user/change_password.html', ctx)
84
81
  return render(request, 'user/change_password.html', ctx)
85
82
 
86
83
 
@@ -101,8 +98,5 @@ def user_change_email(request):
101
98
  if form.is_saved:
102
99
  return redirect('user:detail')
103
100
  ctx.update(form=form)
104
- res = render(request, 'user/change_email.html', ctx)
105
- res.headers['HX-Retarget'] = f'#{ctx["modal_id"]}'
106
- res.headers['HX-Reswap'] = 'outerHTML'
107
- return res
101
+ return ui.update_modal(request, 'user/change_email.html', ctx)
108
102
  return render(request, 'user/change_email.html', ctx)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: accrete
3
- Version: 0.0.130
3
+ Version: 0.0.131
4
4
  Summary: Django Shared Schema Multi Tenant
5
5
  Author-email: Benedikt Jilek <benedikt.jilek@pm.me>
6
6
  License: Copyright (c) 2023 Benedikt Jilek
@@ -60,7 +60,7 @@ accrete/contrib/system_mail/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2
60
60
  accrete/contrib/system_mail/views.py,sha256=xc1IQHrsij7j33TUbo-_oewy3vs03pw_etpBWaMYJl0,63
61
61
  accrete/contrib/system_mail/migrations/0001_initial.py,sha256=6cwkkRXGjXvwXoMjjgmWmcPyXSTlUbhW1vMiHObk9MQ,1074
62
62
  accrete/contrib/system_mail/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
- accrete/contrib/ui/__init__.py,sha256=hZShhQbnjxUnNfzDYS16-Zapo_HPxhIKO3oorZosuyY,184
63
+ accrete/contrib/ui/__init__.py,sha256=n24ecHNTZgyXWhJXLg1P8AAwZKgm5ga3m9yeI-Z2GMs,216
64
64
  accrete/contrib/ui/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
65
65
  accrete/contrib/ui/apps.py,sha256=E0ao2ox6PQ3ldfeR17FXJUUJuGiWjm2DPCxHbPXGzls,152
66
66
  accrete/contrib/ui/context.py,sha256=MLITEVZndD_3QZ4nnBT4Bpl9s1bc7RZ3d6LlQKMM54Q,1922
@@ -69,6 +69,7 @@ accrete/contrib/ui/middleware.py,sha256=QprWR8FXK9iMPIvLQAeYASaUJSW0uD9BHoYroMKr
69
69
  accrete/contrib/ui/models.py,sha256=Vjc0p2XbAPgE6HyTF6vll98A4eDhA5AvaQqsc4kQ9AQ,57
70
70
  accrete/contrib/ui/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
71
71
  accrete/contrib/ui/urls.py,sha256=5XUfK85HYWYf7oopMoJEEYmQ6pNgHgZBErBEn97pBt4,337
72
+ accrete/contrib/ui/utils.py,sha256=WmifdFOuFygGqtHBauAlUw88LTkS4wUZTIy0Vr7cyYg,475
72
73
  accrete/contrib/ui/views.py,sha256=5VUbP0jgMcLMv9-3AKxkV315RA0qXuw5PmTRejPc0Yg,1136
73
74
  accrete/contrib/ui/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
75
  accrete/contrib/ui/static/bulma/LICENSE,sha256=--fY7Bi3Lt7RXXnKc9pe756OJY9fGv-D5OmT5pdSJ5w,1080
@@ -225,7 +226,7 @@ accrete/contrib/user/middleware.py,sha256=qblcujwJsthopagyT-hPFq4HsMyGt-VvqZw5TQ
225
226
  accrete/contrib/user/models.py,sha256=9U7SPbR9IuXhEVdlncsPOZdcbPoWcHRcQi3i25y07Hc,4331
226
227
  accrete/contrib/user/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
227
228
  accrete/contrib/user/urls.py,sha256=_fBa--3NfyYN10Td7PGHpetJYy42SMqTyCCXhgynkEQ,407
228
- accrete/contrib/user/views.py,sha256=8_on6l7GRhoRG74j70JQKUcqxx21AZP_5IRWf0I8ZCc,3447
229
+ accrete/contrib/user/views.py,sha256=uP2n-ixb13JYLpfWoSxg6Xl-Kfcn5oxowJhqIn9ld4c,3217
229
230
  accrete/contrib/user/locale/de/LC_MESSAGES/django.mo,sha256=p3rgUg6WltAVIMkQsjvjBqTsd_usLhSr1GH4Cyltc2c,433
230
231
  accrete/contrib/user/locale/de/LC_MESSAGES/django.po,sha256=f_Nxpo3HTm2L3f3zoHLfeWsZ-4IQp_EEVSku6TCZSvw,1870
231
232
  accrete/contrib/user/migrations/0001_initial.py,sha256=JWfM9PcMDfkJUdCjLWuWieGs6643qP0KdbCyr5uAZoY,2950
@@ -261,7 +262,7 @@ accrete/utils/forms.py,sha256=1UQoG0cXel4Tg-a_cG9doJNrl62a0JMDVEYrT5TSX1s,3383
261
262
  accrete/utils/log.py,sha256=BH0MBDweAjx30wGBO4F3sFhbgkSoEs7T1lLLjlYZNnA,407
262
263
  accrete/utils/models.py,sha256=2xTacvcpmDK_Bp4rAK7JdVLf8HU009LYNJ6eSpMgYZI,1014
263
264
  accrete/utils/views.py,sha256=AutijWetWGgjdO1PNc4gxCblT-i1fAfldNDFRbO9Sac,5012
264
- accrete-0.0.130.dist-info/METADATA,sha256=HFmr4d3mkfMC7k78non4bjbwVwS1W00cAaDawMDELCc,4953
265
- accrete-0.0.130.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
266
- accrete-0.0.130.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
267
- accrete-0.0.130.dist-info/RECORD,,
265
+ accrete-0.0.131.dist-info/METADATA,sha256=U50p60IxKECtHAk-yUBYg9KBgs9gAMpCXD-sTt-euV8,4953
266
+ accrete-0.0.131.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
267
+ accrete-0.0.131.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
268
+ accrete-0.0.131.dist-info/RECORD,,