parent
94956bbf21
commit
9a380454a4
5 changed files with 45 additions and 9 deletions
@ -0,0 +1,11 @@ |
||||
import django_filters |
||||
|
||||
from .models import Course |
||||
|
||||
|
||||
class CourseFilter(django_filters.FilterSet): |
||||
category__title = django_filters.CharFilter(lookup_expr='iexact') |
||||
|
||||
class Meta: |
||||
model = Course |
||||
fields = ['category'] |
||||
@ -1,5 +1,5 @@ |
||||
{% for category in category_items %} |
||||
<a class="header__link" href="#"> |
||||
<a class="header__link" href="{% url 'courses' %}?category={{ category.title }}"> |
||||
<div class="header__title">{{ category.title }}</div> |
||||
</a> |
||||
{% endfor %} |
||||
Loading…
Reference in new issue