bornhack-website/src/info/views.py
Thomas Steen Rasmussen 00af109e2f
add flake8 and isort to pre-commit config, make flake8 and isort happy (#441)
* add flake8 to pre-commit config, and fixup many things to make flake8 happy

* add isort and sort all imports, add to pre-commit and requirements
2020-02-12 13:10:41 +01:00

17 lines
450 B
Python

from django.views.generic import ListView
from camps.mixins import CampViewMixin
from .models import InfoCategory
class CampInfoView(CampViewMixin, ListView):
model = InfoCategory
template_name = "info.html"
context_object_name = "categories"
def get_queryset(self):
queryset = super(CampInfoView, self).get_queryset()
# do not show categories with 0 items
return queryset.exclude(infoitems__isnull=True)