# Reduces db access
* reduces number of queries performed on detail views of intervention, compensation and eco_account
* renders deductable_rest of eco account beneath progressbar on eco account index view
* clarifies ordering logic of related column
This commit is contained in:
@@ -8,6 +8,7 @@ Created on: 18.08.22
|
||||
from django.http import HttpRequest
|
||||
from django.template.loader import render_to_string
|
||||
from django.urls import reverse
|
||||
from django.utils.formats import number_format
|
||||
from django.utils.html import format_html
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
@@ -111,6 +112,7 @@ class EcoAccountTable(BaseTable, TableRenderMixin, TableOrderMixin):
|
||||
except ZeroDivisionError:
|
||||
value_relative = 0
|
||||
html = render_to_string("konova/widgets/progressbar.html", {"value": value_relative})
|
||||
html += f"{number_format(record.deductable_rest, decimal_pos=2)} m²"
|
||||
return format_html(html)
|
||||
|
||||
def render_r(self, value, record: EcoAccount):
|
||||
|
||||
Reference in New Issue
Block a user