mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-11-04 01:12:08 +01:00 
			
		
		
		
	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:
		@@ -215,6 +215,9 @@ class ButtonTable(tables.Table):
 | 
			
		||||
    def render_amount(self, 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):
 | 
			
		||||
        val = '<button id="'
 | 
			
		||||
        val += str(record.pk)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user