Skip to content
This repository has been archived by the owner on Jun 29, 2020. It is now read-only.

Commit

Permalink
product_listにpaginator付けた。とりあえず20件ずつ closes #282
Browse files Browse the repository at this point in the history
  • Loading branch information
giginet committed Oct 18, 2014
1 parent 5e434fd commit eb14291
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/kawaz/apps/products/views.py
@@ -1,3 +1,4 @@
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponseRedirect
from django.views.generic import CreateView
from django.views.generic import UpdateView
Expand Down Expand Up @@ -29,6 +30,7 @@ class ProductListView(FilterView):
model = Product
filterset_class = ProductFilter
template_name_suffix = '_list'
paginate_by = 20


class ProductDetailView(DetailView):
Expand Down
3 changes: 2 additions & 1 deletion src/templates/products/product_list.html
Expand Up @@ -13,7 +13,7 @@ <h1>{% trans "Product List" %}</h1>
{% endblock %}
{% block content-main %}
<div class="row">
{% for product in filter %}
{% for product in object_list %}
<div class="item col-xs-12 col-lg-6">
{% include "products/components/list-item.html" %}
</div>
Expand All @@ -26,6 +26,7 @@ <h1>{% trans "Product List" %}</h1>
</div>
{% endfor %}
</div>
{% include "components/paginator.html" %}
{% endblock %}
{% block content-aside %}
{% if user has 'products.add_product' %}
Expand Down

0 comments on commit eb14291

Please sign in to comment.