call one time all lots

This commit is contained in:
Cayo Puigdefabregas 2022-07-05 18:10:17 +02:00
parent bc8944a498
commit 3a06ade79f
2 changed files with 4 additions and 3 deletions

View File

@ -179,7 +179,7 @@
{% else %} {% else %}
<ul id="incoming-lots-nav" class="nav-content collapse" data-bs-parent="#sidebar-nav"> <ul id="incoming-lots-nav" class="nav-content collapse" data-bs-parent="#sidebar-nav">
{% endif %} {% endif %}
{% for lot in lots %} {% for lot in all_lots %}
{% if lot.is_incoming %} {% if lot.is_incoming %}
<li> <li>
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}"> <a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}">
@ -204,7 +204,7 @@
{% else %} {% else %}
<ul id="outgoing-lots-nav" class="nav-content collapse " data-bs-parent="#sidebar-nav"> <ul id="outgoing-lots-nav" class="nav-content collapse " data-bs-parent="#sidebar-nav">
{% endif %} {% endif %}
{% for lot in lots %} {% for lot in all_lots %}
{% if lot.is_outgoing %} {% if lot.is_outgoing %}
<li> <li>
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}"> <a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}">
@ -235,7 +235,7 @@
<i class="bi bi-plus" style="font-size: larger;"></i><span>New temporary lot</span> <i class="bi bi-plus" style="font-size: larger;"></i><span>New temporary lot</span>
</a> </a>
</li> </li>
{% for lot in lots %} {% for lot in all_lots %}
{% if lot.is_temporary %} {% if lot.is_temporary %}
<li> <li>
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}"> <a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}">

View File

@ -69,6 +69,7 @@ class GenericMixin(View):
def get_context(self): def get_context(self):
self.context = { self.context = {
'lots': self.get_lots(), 'lots': self.get_lots(),
'all_lots': self.get_lots().all(),
'version': __version__, 'version': __version__,
} }