django-unfold 0.28.0__py3-none-any.whl → 0.29.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-unfold
3
- Version: 0.28.0
3
+ Version: 0.29.0
4
4
  Summary: Modern Django admin theme for seamless interface development
5
5
  Home-page: https://unfoldadmin.com
6
6
  License: MIT
@@ -76,6 +76,7 @@ Did you decide to start using Unfold but you don't have time to make the switch
76
76
  - [Custom unfold @action decorator](#custom-unfold-action-decorator)
77
77
  - [Action handler functions](#action-handler-functions)
78
78
  - [Action examples](#action-examples)
79
+ - [Action with form example](#action-with-form-example)
79
80
  - [Filters](#filters)
80
81
  - [Text filters](#text-filters)
81
82
  - [Dropdown filters](#dropdown-filters)
@@ -490,6 +491,63 @@ class UserAdmin(ModelAdmin):
490
491
  )
491
492
  ```
492
493
 
494
+ ### Action with form example
495
+
496
+ Below is an example of an action that will display a form after clicking on the action button on the detail object page.
497
+
498
+ ```python
499
+ from django import forms
500
+ from django.template.loader import render_to_string
501
+ from django.urls import reverse_lazy
502
+
503
+ from unfold.widgets import UnfoldAdminTextInputWidget
504
+
505
+
506
+ class SomeForm(forms.Form):
507
+ # It is important to set a widget coming from Unfold
508
+ note = forms.CharField(label=_("Note"), widget=UnfoldAdminTextInputWidget)
509
+
510
+
511
+ @register(User)
512
+ class UserAdmin(ModelAdmin):
513
+ actions_detail = ["change_detail_action_block"]
514
+ form = SomeForm(request.POST or None)
515
+
516
+ @action(description=_("Detail"))
517
+ def change_detail_action_block(self, request: HttpRequest, object_id: int) -> str:
518
+ user = User.objects.get(pk=object_id)
519
+
520
+ if request.method == "POST" and form.is_valid():
521
+ # Do something with form data
522
+ form.cleaned_data["note"]
523
+
524
+ return redirect(
525
+ reverse_lazy("admin:users_user_change", args=[object_id])
526
+ )
527
+
528
+ return render_to_string("some/template.html", {
529
+ "form": form,
530
+ })
531
+ ```
532
+
533
+ Template displaying the form. Please note that breadcrumbs are empty in this case but if you want, you can configure your own breadcrumbs path.
534
+
535
+ ```html
536
+ {% extends "admin/base_site.html" %}
537
+
538
+ {% block breadcrumbs %}{% endblock %}
539
+
540
+ {% block content %}
541
+ <form action="" method="post" novalidate>
542
+ {% csrf_token %}
543
+
544
+ {% for field in form %}
545
+ {% include "unfold/helpers/field.html" with field=field %}
546
+ {% endfor %}
547
+ </form>
548
+ {% endblock %}
549
+ ```
550
+
493
551
  ## Filters
494
552
 
495
553
  By default, Django admin handles all filters as regular HTML links pointing at the same URL with different query parameters. This approach is for basic filtering more than enough. In the case of more advanced filtering by incorporating input fields, it is not going to work.
@@ -866,7 +924,10 @@ from django_celery_beat.models import (
866
924
  PeriodicTask,
867
925
  SolarSchedule,
868
926
  )
869
-
927
+ from django_celery_beat.admin import ClockedScheduleAdmin as BaseClockedScheduleAdmin
928
+ from django_celery_beat.admin import CrontabScheduleAdmin as BaseCrontabScheduleAdmin
929
+ from django_celery_beat.admin import PeriodicTaskAdmin as BasePeriodicTaskAdmin
930
+ from django_celery_beat.admin import PeriodicTaskForm, TaskSelectWidget
870
931
 
871
932
  admin.site.unregister(PeriodicTask)
872
933
  admin.site.unregister(IntervalSchedule)
@@ -874,18 +935,30 @@ admin.site.unregister(CrontabSchedule)
874
935
  admin.site.unregister(SolarSchedule)
875
936
  admin.site.unregister(ClockedSchedule)
876
937
 
877
- @admin.register(PeriodicTask)
878
- class PeriodicTaskAdmin(ModelAdmin):
938
+
939
+ class UnfoldTaskSelectWidget(UnfoldAdminSelectWidget, TaskSelectWidget):
879
940
  pass
880
941
 
881
942
 
943
+ class UnfoldPeriodicTaskForm(PeriodicTaskForm):
944
+ def __init__(self, *args, **kwargs):
945
+ super().__init__(*args, **kwargs)
946
+ self.fields["task"].widget = UnfoldAdminTextInputWidget()
947
+ self.fields["regtask"].widget = UnfoldTaskSelectWidget()
948
+
949
+
950
+ @admin.register(PeriodicTask)
951
+ class PeriodicTaskAdmin(BasePeriodicTaskAdmin, ModelAdmin):
952
+ form = UnfoldPeriodicTaskForm
953
+
954
+
882
955
  @admin.register(IntervalSchedule)
883
956
  class IntervalScheduleAdmin(ModelAdmin):
884
957
  pass
885
958
 
886
959
 
887
960
  @admin.register(CrontabSchedule)
888
- class CrontabScheduleAdmin(ModelAdmin):
961
+ class CrontabScheduleAdmin(BaseCrontabScheduleAdmin, ModelAdmin):
889
962
  pass
890
963
 
891
964
 
@@ -894,7 +967,7 @@ class SolarScheduleAdmin(ModelAdmin):
894
967
  pass
895
968
 
896
969
  @admin.register(ClockedSchedule)
897
- class ClockedScheduleAdmin(ModelAdmin):
970
+ class ClockedScheduleAdmin(BaseClockedScheduleAdmin, ModelAdmin):
898
971
  pass
899
972
  ```
900
973
 
@@ -1173,6 +1246,7 @@ Below you can find a more complex example which is using multiple components and
1173
1246
  | unfold/components/separator.html | Separator, horizontal rule | class |
1174
1247
  | unfold/components/text.html | Paragraph of text | class |
1175
1248
  | unfold/components/title.html | Basic heading element | class |
1249
+ | unfold/components/button.html | Basic button element | submit |
1176
1250
 
1177
1251
  ## Unfold development
1178
1252
 
@@ -26,7 +26,7 @@ unfold/contrib/forms/static/unfold/forms/js/trix.js,sha256=Pao0XiVeDiRawfTkGDg_n
26
26
  unfold/contrib/forms/templates/unfold/forms/array.html,sha256=11silyHbsJA0U_ksS8MvfFOJKC_qKTAwXxoMIB78APk,1507
27
27
  unfold/contrib/forms/templates/unfold/forms/helpers/toolbar.html,sha256=yS8Zy-UrzvZ5RUYwdprQzREffnYq0NlIbXBfZM2UB04,9700
28
28
  unfold/contrib/forms/templates/unfold/forms/wysiwyg.html,sha256=4ZefV6XrjJlUczcuSw8BhvMJUFSZPSXo1IkgkBivh5g,351
29
- unfold/contrib/forms/widgets.py,sha256=yWug9YQ6FWI7hqvNZqhCwJhlfC_gMh9GELVGTE2Tw9k,2813
29
+ unfold/contrib/forms/widgets.py,sha256=D8utpEv-t_VDkppICA_0jtHvke7uElzAgaGMqd7NBHw,2875
30
30
  unfold/contrib/guardian/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  unfold/contrib/guardian/apps.py,sha256=ObJqwh4vHxkD4XfduP5IQAiYiWZxsXUOUqF1_R1GsRI,136
32
32
  unfold/contrib/guardian/templates/admin/guardian/model/change_form.html,sha256=FSJc4MYYWyzZAy8Ay0b7Ov-cUo-oELHOM5fQehM54Lg,403
@@ -60,9 +60,9 @@ unfold/contrib/inlines/checks.py,sha256=8sdyBcxw0erqQvp9sHlpGgy0rXfum-cd2eQE0rXF
60
60
  unfold/contrib/inlines/forms.py,sha256=R9OJvrbqNLlKvTxw97JjElCY4CQ3IyRIkjIJUN0gJ9k,1323
61
61
  unfold/contrib/simple_history/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  unfold/contrib/simple_history/apps.py,sha256=eF_KVYb60CAnGgWk2Z1YKYGfgA3TJBMr229qI7e2pgU,153
63
- unfold/contrib/simple_history/templates/simple_history/_object_history_list.html,sha256=aXOQ1zwsRBlFmzODsZApvMtb8t1IPXim6i4plXUR5XE,5112
64
- unfold/contrib/simple_history/templates/simple_history/object_history.html,sha256=AZ6uQRr7wKxV_rys5hGTVGYtVS-Fp5eHIqiXYW8FB1c,847
63
+ unfold/contrib/simple_history/templates/simple_history/object_history.html,sha256=ioBkepWc9-PQe4Kfy32RKOt_zf4fntz5XUfFeV3yQVw,771
65
64
  unfold/contrib/simple_history/templates/simple_history/object_history_form.html,sha256=MOL3Tw3Nk3Rnq1koRV7yeCev4CP06_4xqAIOQk1M7FU,2290
65
+ unfold/contrib/simple_history/templates/simple_history/object_history_list.html,sha256=-QAWguUzGtD08_LBBk00_5ZYUjnso-q6dLXSeALc0n4,7449
66
66
  unfold/contrib/simple_history/templates/simple_history/submit_line.html,sha256=ns9CEkU4HwKHhhj8qj_9UXvzp0viGtD1tp93GV2WRCs,1703
67
67
  unfold/dataclasses.py,sha256=XssBT3nfeFO-oekKDWrX6abIyrIW1P8CPzzCv1TRYFM,266
68
68
  unfold/decorators.py,sha256=6E4vPVwK0IQDAiDPg9pgyypRqciX_gR0jwITDcrSc8U,3367
@@ -72,7 +72,7 @@ unfold/forms.py,sha256=GXEm3CFwglyuEbGdVyEMJTB45Gs-_RvGGlXJEkPy2kw,3688
72
72
  unfold/settings.py,sha256=--TdTSWdOA8TQGW4-vjJkjy_zEyd_kZwBr3BIuQ8hzI,1208
73
73
  unfold/sites.py,sha256=Gy_i43j2nizW2g8-mas5icvtk-beKism_CznATW6Ia8,12586
74
74
  unfold/static/unfold/css/simplebar.css,sha256=5LLaEM11pKi6JFCOLt4XKuZxTpT9rpdq_tNlaQytFlU,4647
75
- unfold/static/unfold/css/styles.css,sha256=CU9SCfH3nREI3C6yP9DFAvvr_23lSg9H6rAwM0_w958,91898
75
+ unfold/static/unfold/css/styles.css,sha256=kNET3XR4Z7z0jxk19SNztMFwpZqUDgaIIWd715pYkcc,94573
76
76
  unfold/static/unfold/fonts/inter/Inter-Bold.woff2,sha256=O88EyjAeRPE_QEyKBKpK5wf2epUOEu8wwjj5bnhCZqE,46552
77
77
  unfold/static/unfold/fonts/inter/Inter-Medium.woff2,sha256=O88EyjAeRPE_QEyKBKpK5wf2epUOEu8wwjj5bnhCZqE,46552
78
78
  unfold/static/unfold/fonts/inter/Inter-Regular.woff2,sha256=O88EyjAeRPE_QEyKBKpK5wf2epUOEu8wwjj5bnhCZqE,46552
@@ -86,7 +86,7 @@ unfold/static/unfold/js/app.js,sha256=CIitJoFqpeZYPw8icGVXYX9tVRUgqFxcPZ2WjWS8Yl
86
86
  unfold/static/unfold/js/chart.js,sha256=22W6cFERR-CElMOKRgMMicueMVP0Vf7FBEBYH8Z8tCk,200633
87
87
  unfold/static/unfold/js/htmx.js,sha256=XOLqvnZiyEx46EW9vaJTBUaaWg8CGVVfXJkVsUmJbpI,42820
88
88
  unfold/static/unfold/js/simplebar.js,sha256=t-uG1FAD6ZoiMeN--wac0XRS7SxoDVG6zvRnGuEp7X8,27176
89
- unfold/styles.css,sha256=JA2ybI-pzRM4ZOKshI187oJ5Z3gMNWHQAuEfwq5Xb_E,17854
89
+ unfold/styles.css,sha256=-NgJI9uEPWEWFlkmkaql4EkSySZyWcH__q8ESkWM58I,18266
90
90
  unfold/templates/admin/actions.html,sha256=1tVlUpLoM72K2Ew4vQGcRwPjHuAtO5Jm4QdDsDLOq0I,2625
91
91
  unfold/templates/admin/app_index.html,sha256=lVjMIFsspHQ09LGHKfdfg7TlqlL39AX5LbwoeoZjFhk,1335
92
92
  unfold/templates/admin/app_list.html,sha256=krDzw2EXqqvIi8bJtPhJsNran9H7hwdhM6ZW_IRlDwQ,3038
@@ -94,7 +94,7 @@ unfold/templates/admin/auth/user/add_form.html,sha256=iLig-vd2YExXsj0xGBwYhZ4kGU
94
94
  unfold/templates/admin/auth/user/change_password.html,sha256=-Wa9ml3yss-kDz0YQxCiwoxs91KQD8eetCt5l6xekWM,2892
95
95
  unfold/templates/admin/base.html,sha256=MGqtCcydXZPnp6dasaWktyd9D6rdUYX01rFGAv7Zkm4,2226
96
96
  unfold/templates/admin/base_site.html,sha256=3ckWrcAdd7Pw1hk6Zwyknab_Qb-rteV9-mXhMnfo6VI,361
97
- unfold/templates/admin/change_form.html,sha256=s7iHvcH1coJQu7QaDk6vx_tvgxMG8SQWEy4J9bBllzY,5361
97
+ unfold/templates/admin/change_form.html,sha256=oWK5wr0qv6QMJrFQ9Veacozg_CN1DwmBqbzPOuDtiA4,4443
98
98
  unfold/templates/admin/change_form_object_tools.html,sha256=eyeH-i2HgEM0Yi-OJA2D1VnKJyC19A_my1IDGxxoP8Y,593
99
99
  unfold/templates/admin/change_list.html,sha256=18GDZswc1c0xtw2BcKti9SX95Ar9e1BX_HSY0K79g_8,5102
100
100
  unfold/templates/admin/change_list_object_tools.html,sha256=cmMiT2nT20Ph5yfpj9aHPr76Z-JP4aSXp0o-Rnad28s,147
@@ -103,7 +103,7 @@ unfold/templates/admin/date_hierarchy.html,sha256=BfUPbsLpHZVa40BHBahz1H9RSVuz36
103
103
  unfold/templates/admin/delete_confirmation.html,sha256=hpa2E14oZEXBBs6W1qdNQuF650TIO2Rhr52Q6UfwVeQ,5166
104
104
  unfold/templates/admin/delete_selected_confirmation.html,sha256=Foka2yvwAMEZre-Kh1KNadRzrCotdKM2U4e6AJQYZu8,4941
105
105
  unfold/templates/admin/edit_inline/stacked.html,sha256=HG-Dj42gcKNofHRVjg0ltIER2oJGYUd9GN_B7lDv7rQ,4580
106
- unfold/templates/admin/edit_inline/tabular.html,sha256=aMy6kk3ZDBtgZFf1pO30vHWmONvCYor9yoiR9Day4xI,13042
106
+ unfold/templates/admin/edit_inline/tabular.html,sha256=NBwTLA7J0_SYCJA6TOJfNLtstFFrh7yXW6iRhwC_xc4,13038
107
107
  unfold/templates/admin/filter.html,sha256=dkrFkei-EAlldIU8DrgvSChzWQuUOu6-LS_qlZxdfFw,1708
108
108
  unfold/templates/admin/includes/fieldset.html,sha256=lMVwBifFWKvLvHqZ6yjP6Xf6BJFzi-EOf5JHIxEHmRI,888
109
109
  unfold/templates/admin/includes/object_delete_summary.html,sha256=Nv69SCzyJHFX14iJFfodxKM0IIpQegKZH0fvKB15QJI,468
@@ -119,6 +119,7 @@ unfold/templates/registration/logged_out.html,sha256=E7RHtB6AGQwgUIiV7dwJ1DbdfNv
119
119
  unfold/templates/registration/password_change_done.html,sha256=i1ZzfTwZHWNWoN9_xHZDdcgLdTOVbTFFD1HUSuG0LkY,1062
120
120
  unfold/templates/registration/password_change_form.html,sha256=zzmqFHfMExS7czgEBdEtetXk2Ae_7jzaID7CpE_xlgo,2225
121
121
  unfold/templates/unfold/change_list_filter.html,sha256=bUDjrVuvE1soFncP8O7qrGonk9O4ozD-nFpbNs3NcrM,2172
122
+ unfold/templates/unfold/components/button.html,sha256=M_kn5fJPadvBfTUdN56-LMkouvfpUMga7orRJoVifgc,178
122
123
  unfold/templates/unfold/components/card.html,sha256=F0iaFv4F8NOjhka24XJHckJxub_Yhq2tJ4cLu6aTHwI,799
123
124
  unfold/templates/unfold/components/chart/bar.html,sha256=nDdDCUXvFd793OpNgNPQo0vBmvYngMsQyPHVTf1vfOw,297
124
125
  unfold/templates/unfold/components/chart/line.html,sha256=DHaZUFTlCs5cX7ioYdTzoN4ITHWNcEoNSUp7v3hlo_E,298
@@ -129,20 +130,20 @@ unfold/templates/unfold/components/progress.html,sha256=pfdSjZD17IK4L5kGO8tRYikp
129
130
  unfold/templates/unfold/components/separator.html,sha256=G0IlKIFEXJmLZc0KP2YcsLzkaskeb0PrLvOdoKFTgmc,90
130
131
  unfold/templates/unfold/components/text.html,sha256=-GjxvdiaBQIaNfPSzT6SSIwnc3R27FkSDQMoF3FDPso,102
131
132
  unfold/templates/unfold/components/title.html,sha256=PSiNK-s8jUJfu6f9zCcGOOyLiKxS-dsAFu3aR-yjNdU,131
132
- unfold/templates/unfold/helpers/account_links.html,sha256=Kc1FobAVN3B34x9vcMoEXyuQ45d5SjfjaJSo3UErL3Q,1934
133
+ unfold/templates/unfold/helpers/account_links.html,sha256=4iddfRn6yHZG--aEEme4XnxQa6-gh0jyVt6ymGKb6Xo,1939
133
134
  unfold/templates/unfold/helpers/actions_row.html,sha256=1xd39zx38NOoKuDuxAG7PHeu5x2OTIraQGFkm15Erqg,1681
134
135
  unfold/templates/unfold/helpers/add_link.html,sha256=mIgpKrwqBO1oJ4cwPQWSX1oUHBwHJmy5-2TxUHf-1bo,808
135
136
  unfold/templates/unfold/helpers/app_list.html,sha256=lFnW8p9DcZbI9t3_ee9JX9ERHA0NRL2V88zpzuG4jq8,4720
136
137
  unfold/templates/unfold/helpers/app_list_default.html,sha256=vZkw1F7oHOKReNkdHRYjhuNdA1nNdvSD4wbDmf0bnsM,4102
137
138
  unfold/templates/unfold/helpers/attrs.html,sha256=Mwpj72kuwYj8hOT3J2T8qx6f1r_4xwwaS1slHA-82jI,166
138
- unfold/templates/unfold/helpers/boolean.html,sha256=p_WOlytoXvDwta76WgcV4JSWKpBgKf4amhqmHF798F8,564
139
+ unfold/templates/unfold/helpers/boolean.html,sha256=6gXAMEJcNVB14je9uN32dxImXP3KMCiWPeKU5EAnawA,569
139
140
  unfold/templates/unfold/helpers/breadcrumb_item.html,sha256=k_1j57UV0WtzFFlMKaewj4NLbR_DhXI6RzCHThblZLw,234
140
141
  unfold/templates/unfold/helpers/display_header.html,sha256=HiuaIJ6Y8DSM99OFypLO_2uQadZIw7tSg1aJJpFEXkM,1161
141
142
  unfold/templates/unfold/helpers/display_label.html,sha256=LS9DWzYjHkYLV27sZDwyXlg2sLJ0AlId9FbjnXpsbfg,317
142
143
  unfold/templates/unfold/helpers/field.html,sha256=Ds-zUHkdyxamfUCVNhxvtM0XoJg9OCA0QcsLbLWv4oo,882
143
144
  unfold/templates/unfold/helpers/field_readonly.html,sha256=O0gHEW46OWt1oUUk0lZiyR-mztWv_7IH6GpKRm2wUw4,235
144
- unfold/templates/unfold/helpers/field_readonly_value.html,sha256=wdzHVKaI96S-S1MaV-odKXDdT_MRkfWMcXdUBhRlTDY,490
145
- unfold/templates/unfold/helpers/fieldset_row.html,sha256=pcVBMudv1QDZp840S9a_8BuFb1DzUWBmsPUZI7lfgDo,2751
145
+ unfold/templates/unfold/helpers/field_readonly_value.html,sha256=iKVTcAj0AMDI6NU780JWc_S04YyZbxLtNRzW9gGrjRU,451
146
+ unfold/templates/unfold/helpers/fieldset_row.html,sha256=D3RLCcUouJo1RW4vW7TCKssKmm8NaqUN0w9eoqTXuSE,4135
146
147
  unfold/templates/unfold/helpers/fieldsets_tabs.html,sha256=V3bgW75eozaBDty-xfciGafhCWq_Ba5HfQkk92yRc9A,1445
147
148
  unfold/templates/unfold/helpers/form_errors.html,sha256=EwerIJptSCWXvtAJ1IZKfEn98qlShBIGavsTThbklAs,266
148
149
  unfold/templates/unfold/helpers/form_label.html,sha256=SR4U6iK9w4oels6iGY_Da-yN4BbXQVN9zCDlBGGXcw8,310
@@ -154,7 +155,7 @@ unfold/templates/unfold/helpers/messages/error.html,sha256=mlHVdfpG2ycsKIDBJB9CZ
154
155
  unfold/templates/unfold/helpers/messages/errornote.html,sha256=5ChxoVYkF4jI-cw72gVHh0CRxDnG9ME_U6UQOArax2k,404
155
156
  unfold/templates/unfold/helpers/messages/info.html,sha256=js95Hm3CzqpP6_XJpnA2vG7qt8eyHmJJJcDF0e5PLtQ,143
156
157
  unfold/templates/unfold/helpers/messages.html,sha256=axUkgdYQySOTKEuRBDkohXFf8dM1ioQt5m6iAR7Ls18,701
157
- unfold/templates/unfold/helpers/navigation.html,sha256=Nmgk6_690AeHgKE0-YS7tQYq2sOnn3jUZnBhcluR-QE,1067
158
+ unfold/templates/unfold/helpers/navigation.html,sha256=FDfhWxw_alDPlcARm9Zik1_-177RC7o8jLJPv0ldOc0,1067
158
159
  unfold/templates/unfold/helpers/pagination_current_item.html,sha256=4cZ2KLVcP0Y7xuGyXgexDQ07r94cgM5Gnmtv11dkRPQ,69
159
160
  unfold/templates/unfold/helpers/pagination_ellipsis.html,sha256=Ar9Ntf2I_79mIVW5Hadwkn1Kx1Lj3d8eIXNXI1IIBfg,56
160
161
  unfold/templates/unfold/helpers/search.html,sha256=T3JLlzEeHTEpX6qfjNQ0cQPW2rtVIOyE9quEyVHVXsA,1382
@@ -162,9 +163,9 @@ unfold/templates/unfold/helpers/search_results.html,sha256=N5CNMJSF91jbJS6OQP0nA
162
163
  unfold/templates/unfold/helpers/site_icon.html,sha256=RO-R5yRt6yOx41Z8dpDP4lzwMXFdz8Dp5j8vGUtHzh0,789
163
164
  unfold/templates/unfold/helpers/site_logo.html,sha256=05tqXzHy--pluceRQ2jDUZCFX9DjPHdBqGaieUv9sXk,424
164
165
  unfold/templates/unfold/helpers/submit.html,sha256=oSzq85LRLhdOlbFtFZFhYm6ucT95u6LunTeSTDClszQ,206
165
- unfold/templates/unfold/helpers/tab_action.html,sha256=wanUlr_CKqSjxvKC7_moHFWK-hd7aT3KDdNATkJE2XE,337
166
- unfold/templates/unfold/helpers/tab_list.html,sha256=WMFSx0HEvylI_AOIPtFuWff1ePJkY6HS-PhRwo0EBUk,2029
167
- unfold/templates/unfold/helpers/theme_switch.html,sha256=skkl6fYUnYLM7fAPivHxWjnOnuQSKa-7aDxh7I8dGIg,2266
166
+ unfold/templates/unfold/helpers/tab_action.html,sha256=FMj_aWoVbY4xGXFSkLv94IoiN-N7yy33T_EnDgcXfe4,403
167
+ unfold/templates/unfold/helpers/tab_list.html,sha256=MUtQM63uH5XB6A3SN1pagB_GuRVAPNWfI9Y-xsMPyRg,2266
168
+ unfold/templates/unfold/helpers/theme_switch.html,sha256=B5wfWEoMjLJp6V8aR0ClN-_ZUcjU--Jclbqny2sEmNM,2271
168
169
  unfold/templates/unfold/helpers/userlinks.html,sha256=qWjtBt9Q_tU8a874ii0Qqg8t_d-SSYBTB_3QZfNlx9g,634
169
170
  unfold/templates/unfold/helpers/welcomemsg.html,sha256=noRysgSENef4_53pXaTiBCy2or6lQm1ZtmCQVODAB1c,1120
170
171
  unfold/templates/unfold/layouts/base.html,sha256=bAXZDbyiyxNiE-49mqr7pHUFhC2mHZQzIDUY-js_yZ0,379
@@ -173,25 +174,25 @@ unfold/templates/unfold/layouts/skeleton.html,sha256=iXrUiggVp36vmBIia5p32c-9Ruy
173
174
  unfold/templates/unfold/widgets/clearable_file_input.html,sha256=gAJsfyCnanOyeN4ypp1y7r76znvITV7FYTyWvPsmlDs,1882
174
175
  unfold/templates/unfold/widgets/clearable_file_input_small.html,sha256=LPgiKuMAYPiEupFxdlwc1TozNRV1w9ekdRuv-5P4fgw,2531
175
176
  unfold/templates/unfold/widgets/date.html,sha256=WXo2LG1v_gBZBSg-zocj7oujMKI0MWLYCIFfB04HMLQ,122
176
- unfold/templates/unfold/widgets/foreign_key_raw_id.html,sha256=BgXi4ziywtkWmZuUye5bbJ6yeEoHDJB_2lkwXX8hc6c,1026
177
+ unfold/templates/unfold/widgets/foreign_key_raw_id.html,sha256=VyJjnN0v75-NFb_O25smszKzlRXwl_H9zyPsrBLb11g,1036
177
178
  unfold/templates/unfold/widgets/radio.html,sha256=3WcmclQNg7R_pRjEHL1dHkGjAzWlWNYnhHkAirC4nuA,646
178
179
  unfold/templates/unfold/widgets/radio_option.html,sha256=IZgPx-aWKJuxrSalJ3K50RFd1vwSpb9Qk0yZwfV78_A,368
179
180
  unfold/templates/unfold/widgets/range.html,sha256=28FBtSUgUcG82vpk_I27Lbs5oWZOV_oMzVhx4wj3-Ik,262
180
181
  unfold/templates/unfold/widgets/related_widget_wrapper.html,sha256=0I6wSu8z_sJPqmX6uZev4mQGIIM336d6kvHdHj36ny4,3831
181
- unfold/templates/unfold/widgets/split_datetime.html,sha256=eXLFZyCv84LCTFWAUhNO3xAIzWvGBvI1ZpYbB38_HOI,862
182
+ unfold/templates/unfold/widgets/split_datetime.html,sha256=u4pSJOVAb4HIzZc4oQmRZe76jtoDx5Ils6b-Gw38LRU,1688
182
183
  unfold/templates/unfold/widgets/split_datetime_vertical.html,sha256=xinCH4kkQ-yKUqcSI7-m-_UEzOEKWqvLTjUa3i-e8EM,881
183
184
  unfold/templates/unfold/widgets/split_money.html,sha256=AFLUBmzGbY-RXgsfz7gaDxVRhplaIPhXjg_hWYo9xcY,352
184
185
  unfold/templates/unfold/widgets/textarea.html,sha256=-ZLDGrtASero7L-J3VvTNq_KjPAZh_kLVw0Ow3awqXM,144
185
186
  unfold/templates/unfold/widgets/textarea_expandable.html,sha256=4xIGWb20DuwiwumndByrAyh7xF-ReXKLulSpDImX_cs,459
186
187
  unfold/templates/unfold/widgets/time.html,sha256=WXo2LG1v_gBZBSg-zocj7oujMKI0MWLYCIFfB04HMLQ,122
187
188
  unfold/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
188
- unfold/templatetags/unfold.py,sha256=HFe0GrTD4va0lLzsZhxqjEOONmehqOWdf5vulkxgfGU,6302
189
+ unfold/templatetags/unfold.py,sha256=mz5mq7fj2381BEQE6UguBWnBa9gjs1m1DrT5iuXE5nc,6363
189
190
  unfold/templatetags/unfold_list.py,sha256=5xAjQX0_JnVwDaj-wGkGqbjOAtp-a18koWIKj5VfBz0,13867
190
191
  unfold/typing.py,sha256=1P8PWM2oeaceUJtA5j071RbKEBpHYaux441u7Hd6wv4,643
191
192
  unfold/utils.py,sha256=zZdJE4FmwRd7p5a7sJiAoZjBOJitXJduOq7BulyppWM,4803
192
193
  unfold/views.py,sha256=hQCyeeMa9kcJV1IZeeYqj8PGW7J4QWME8n-5n0UGmiU,1003
193
- unfold/widgets.py,sha256=w9BnJ6LYaFJJG7eJGJ-NKwqSHh6iUExN4P94WRvZO_c,15575
194
- django_unfold-0.28.0.dist-info/LICENSE.md,sha256=Ltk_quRyyvV3J5v3brtOqmibeZSw2Hrb8bY1W3ya0Ik,1077
195
- django_unfold-0.28.0.dist-info/METADATA,sha256=_i3r1OdWajR9BKmzMzYuPv91IyuKVKMvSTu6ufCwl8E,50658
196
- django_unfold-0.28.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
197
- django_unfold-0.28.0.dist-info/RECORD,,
194
+ unfold/widgets.py,sha256=QEcfHCo4q-skqbvqK1h1ETGQp8PItjyQRfMViKr-cYM,15672
195
+ django_unfold-0.29.0.dist-info/LICENSE.md,sha256=Ltk_quRyyvV3J5v3brtOqmibeZSw2Hrb8bY1W3ya0Ik,1077
196
+ django_unfold-0.29.0.dist-info/METADATA,sha256=RBUo27nttbIHWftk2qUxkCQYUgaaiVM3LUwy_4MBUpo,53236
197
+ django_unfold-0.29.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
198
+ django_unfold-0.29.0.dist-info/RECORD,,
@@ -60,6 +60,8 @@ class ArrayWidget(MultiWidget):
60
60
 
61
61
  def decompress(self, value: Union[str, List]) -> List:
62
62
  if isinstance(value, List):
63
+ return value
64
+ elif isinstance(value, str):
63
65
  return value.split(",")
64
66
 
65
67
  return []
@@ -1,8 +1,6 @@
1
1
  {% extends "admin/object_history.html" %}
2
2
 
3
- {% load admin_urls i18n %}
4
- {% load url from simple_history_compat %}
5
- {% load display_list from simple_history_admin_list %}
3
+ {% load i18n %}
6
4
 
7
5
  {% block content %}
8
6
  {% if not revert_disabled %}
@@ -11,8 +9,8 @@
11
9
  </p>
12
10
  {% endif %}
13
11
 
14
- {% if action_list %}
15
- {% display_list %}
12
+ {% if historical_records %}
13
+ {% include object_history_list_template %}
16
14
  {% else %}
17
15
  <p class="mb-3 px-3 py-3 rounded-md text-sm last:mb-8 bg-amber-100 text-amber-600 dark:bg-amber-600/20 dark:border-amber-600/10">
18
16
  {% trans "This object doesn't have a change history." %}
@@ -31,40 +31,44 @@
31
31
  <th class="align-middle font-medium px-3 py-2 text-left text-gray-400 text-sm">
32
32
  {% trans 'Change reason' %}
33
33
  </th>
34
+
35
+ <th class="align-middle font-medium px-3 py-2 text-left text-gray-400 text-sm">
36
+ {% trans 'Changes' %}
37
+ </th>
34
38
  </tr>
35
39
  </thead>
36
40
 
37
41
  <tbody>
38
- {% for action in action_list %}
42
+ {% for record in historical_records %}
39
43
  <tr class="block border mb-3 rounded-md shadow-sm lg:table-row lg:border-none lg:mb-0 lg:shadow-none dark:border-gray-800">
40
44
  <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans 'Object' %}">
41
- <a href="{% url opts|admin_urlname:'simple_history' object.pk action.pk %}">
42
- {{ action.history_object }}
45
+ <a href="{% url opts|admin_urlname:'simple_history' object.pk record.pk %}">
46
+ {{ record.history_object }}
43
47
  </a>
44
48
  </td>
45
49
 
46
50
  {% for column in history_list_display %}
47
51
  <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans column %}">
48
- {{ action|getattribute:column }}
52
+ {{ record|getattribute:column }}
49
53
  </th>
50
54
  {% endfor %}
51
55
 
52
56
  <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans 'Date/time' %}">
53
- {{ action.history_date }}
57
+ {{ record.history_date }}
54
58
  </td>
55
59
 
56
60
  <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans 'Comment' %}">
57
- {{ action.get_history_type_display }}
61
+ {{ record.get_history_type_display }}
58
62
  </td>
59
63
 
60
64
  <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans 'Changed by' %}">
61
- {% if action.history_user %}
62
- {% url admin_user_view action.history_user_id as admin_user_url %}
65
+ {% if record.history_user %}
66
+ {% url admin_user_view record.history_user_id as admin_user_url %}
63
67
 
64
68
  {% if admin_user_url %}
65
- <a href="{{ admin_user_url }}">{{ action.history_user }}</a>
69
+ <a href="{{ admin_user_url }}">{{ record.history_user }}</a>
66
70
  {% else %}
67
- {{ action.history_user }}
71
+ {{ record.history_user }}
68
72
  {% endif %}
69
73
  {% else %}
70
74
  {% trans "None" %}
@@ -72,7 +76,41 @@
72
76
  </td>
73
77
 
74
78
  <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans 'Change reason' %}">
75
- {{ action.history_change_reason }}
79
+ {{ record.history_change_reason }}
80
+ </td>
81
+
82
+ <td class="align-middle flex border-t border-gray-200 font-normal px-3 py-2 text-left text-sm before:flex before:capitalize before:content-[attr(data-label)] before:items-center before:mr-auto before:text-gray-500 first:border-t-0 dark:before:text-gray-400 lg:before:hidden lg:first:border-t lg:py-3 lg:table-cell dark:border-gray-800" data-label="{% trans 'Changes' %}">
83
+ {% block history_delta_changes %}
84
+ {% if record.history_delta_changes %}
85
+ <ul>
86
+ {% for change in record.history_delta_changes %}
87
+ <li class="flex flex-row gap-2">
88
+ <strong class="font-medium text-gray-700 dark:text-gray-200">
89
+ {{ change.field }}:
90
+ </strong>
91
+
92
+ <div class="flex flex-row items-center gap-2">
93
+ {% if change.old %}
94
+ <span>
95
+ {{ change.old }}
96
+ </span>
97
+ {% endif %}
98
+
99
+ {% if change.old and change.new %}
100
+ <span class="align-text-top material-symbols-outlined md-18 text-gray-300 group-hover:text-gray-400 dark:text-gray-600">arrow_right_alt</span>
101
+ {% endif %}
102
+
103
+ {% if change.new %}
104
+ <span>
105
+ {{ change.new }}
106
+ </span>
107
+ {% endif %}
108
+ </div>
109
+ </li>
110
+ {% endfor %}
111
+ </ul>
112
+ {% endif %}
113
+ {% endblock %}
76
114
  </td>
77
115
  </tr>
78
116
  {% endfor %}