Improves query efficiency for shelve buttons

About 50 fewer queries (yikes)
This commit is contained in:
Mouse Reeve
2021-05-22 17:58:08 -07:00
parent 368d2cd716
commit 3d3ab6433e
6 changed files with 9 additions and 8 deletions

View File

@ -5,7 +5,7 @@
<div class="select is-small mt-1 mb-3">
<select name="{{ book.id }}" aria-label="{% blocktrans with book_title=book.title %}Have you read {{ book_title }}?{% endblocktrans %}">
<option disabled selected value>Add to your books</option>
{% for shelf in request.user.shelf_set.all %}
{% for shelf in user_shelves %}
<option value="{{ shelf.id }}">{{ shelf.name }}</option>
{% endfor %}
</select>