rename the articles_list in the category view

This commit is contained in:
Andreas Zweili 2018-01-28 21:09:27 +01:00
parent fb6831920c
commit 62db260ec1
2 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
{% extends "webshop/base.html" %} {% extends "webshop/base.html" %}
{% block section_title %}Category Overview{% endblock %} {% block section_title %}Category Overview{% endblock %}
{% block content %} {% block content %}
{% if article_list %} {% if articles_list %}
<table class="table"> <table class="table">
<tr class="table_header"> <tr class="table_header">
<th scope="col">ID</th> <th scope="col">ID</th>
@ -10,7 +10,7 @@
<th scope="col">STOCK</th> <th scope="col">STOCK</th>
<th scope="col">PRICE</th> <th scope="col">PRICE</th>
</tr> </tr>
{% for article in article_list %} {% for article in articles_list %}
<tr class="table_content"> <tr class="table_content">
<td scope="col">{{ article.id }}</td> <td scope="col">{{ article.id }}</td>
<td scope="col"> <td scope="col">

View File

@ -69,12 +69,12 @@ def articles_in_category(request, category_id):
selected_category = Category.objects.get(id=category_id) selected_category = Category.objects.get(id=category_id)
hidden = ArticleStatus.objects.get(name="hidden") hidden = ArticleStatus.objects.get(name="hidden")
article_list = Article.objects.filter( articles_list = Article.objects.filter(
category=selected_category.id).exclude(status=hidden.id) category=selected_category.id).exclude(status=get_hidden_status_id())
return render(request, 'webshop/category.html', return render(request, 'webshop/category.html',
{'article_list': article_list, {'articles_list': articles_list,
'category_list': category_list, 'category_list': category_list,
'category': selected_category}) 'category': selected_category})