mirror of https://gitlab.crans.org/bde/nk20
Sort buttons by category name instead of id in button list
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
7848cd9cc2
commit
58cafad032
|
@ -215,6 +215,9 @@ class ButtonTable(tables.Table):
|
||||||
def render_amount(self, value):
|
def render_amount(self, value):
|
||||||
return pretty_money(value)
|
return pretty_money(value)
|
||||||
|
|
||||||
|
def order_category(self, queryset, is_descending):
|
||||||
|
return queryset.order_by(f"{'-' if is_descending else ''}category__name"), True
|
||||||
|
|
||||||
def render_hideshow(self, record):
|
def render_hideshow(self, record):
|
||||||
val = '<button id="'
|
val = '<button id="'
|
||||||
val += str(record.pk)
|
val += str(record.pk)
|
||||||
|
|
Loading…
Reference in New Issue