NOJIRA added itemcounter

This commit is contained in:
2021-09-15 17:31:13 +02:00
parent 05b5ee96df
commit b4b41d24b9
2 changed files with 5 additions and 1 deletions

View File

@@ -28,6 +28,10 @@ class DTO:
def items(self) -> List[Item]: def items(self) -> List[Item]:
return sorted([Item(name, amount) for name, amount in self.__items.items()]) return sorted([Item(name, amount) for name, amount in self.__items.items()])
@property
def item_count(self) -> int:
return sum(self.__items.values())
@property @property
def applicants(self) -> List[str]: def applicants(self) -> List[str]:
return sorted(self.__applicants) return sorted(self.__applicants)

View File

@@ -13,7 +13,7 @@
{% endfor %} {% endfor %}
</ol> </ol>
<h1>Streeplijst</h1> <h1>Streeplijst - {{ data.item_count }} stuks</h1>
<ul> <ul>
{% for item in data.items %} {% for item in data.items %}
<li>{{ item.name }}: {{ item.amount }}</li> <li>{{ item.name }}: {{ item.amount }}</li>