#21902 - upgrade to django-tables2 v3.0

This commit is contained in:
Arthur 2026-05-26 11:22:07 -07:00 committed by Jeremy Stretch
parent bd529761bc
commit 63e1da416c
4 changed files with 5 additions and 6 deletions

View File

@ -57,8 +57,7 @@ django-storages
# Abstraction models for rendering and paginating HTML tables
# https://github.com/jieter/django-tables2/blob/master/CHANGELOG.md
# See #21902 for upgrading to django-tables2 v2.9+
django-tables2<2.9
django-tables2
# User-defined tags for objects
# https://github.com/jazzband/django-taggit/blob/master/CHANGELOG.rst

View File

@ -6,7 +6,7 @@
<tr>
{% for column in table.columns %}
{% if column.orderable %}
<th {{ column.attrs.th.as_html }}><a href="{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}">{{ column.header }}</a></th>
<th {{ column.attrs.th.as_html }}><a href="{% querystring_replace table.prefixed_order_by_field=column.order_by_alias.next %}">{{ column.header }}</a></th>
{% else %}
<th {{ column.attrs.th.as_html }}>{{ column.header }}</th>
{% endif %}

View File

@ -13,14 +13,14 @@
{% if column.is_ordered %}
<div class="float-end">
<a href="#"
hx-get="{{ table.htmx_url }}{% querystring table.prefixed_order_by_field='' %}"
hx-get="{{ table.htmx_url }}{% querystring_replace table.prefixed_order_by_field='' %}"
class="text-danger"
title="{% trans "Clear ordering" %}"
><i class="mdi mdi-close"></i></a>
</div>
{% endif %}
<a href="#"
hx-get="{{ table.htmx_url }}{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}"
hx-get="{{ table.htmx_url }}{% querystring_replace table.prefixed_order_by_field=column.order_by_alias.next %}"
>{{ column.header }}</a>
</th>
{% else %}

View File

@ -12,7 +12,7 @@ django-redis==6.0.0
django-rich==2.2.0
django-rq==4.1.0
django-storages==1.14.6
django-tables2==2.8.0
django-tables2==3.0.0
django-taggit==6.1.0
django-timezone-field==7.2.1
djangorestframework==3.17.1