##views.py class Sorted(TemplateView): template_name = "category.html" def get_context_data(self, **kwargs): context = super(Sorted, self).get_context_data(**kwargs) context['brands'] = Brand.objects.all() context['sizes'] = Size.objects.all() return context
#urls.py from product.views import Sorted url(r'^(?P<sect>\w+)/cat/(?P<cat>\d+(-\d+)*)/$', Sorted.as_view()),
В шаблоне принимаю
{% for brand in brands %} <label class="checkbox"> <input type="checkbox"> <a href="/man/brand/{{ brand.id }}/">{{ brand.name }}</a> </label> {% endfor %}
В результате возвращает пустой шаблон, но данные не выводит.