bornhack-website/src/sponsors/views.py

21 lines
489 B
Python
Raw Normal View History

2017-07-15 09:00:59 +00:00
from django.views.generic import TemplateView, ListView
2016-12-28 23:15:13 +00:00
from camps.mixins import CampViewMixin
2017-07-15 09:00:59 +00:00
from .models import Sponsor
2016-12-28 23:15:13 +00:00
2017-07-15 09:00:59 +00:00
class SponsorsView(CampViewMixin, ListView):
model = Sponsor
template_name = 'sponsors.html'
context_object_name = 'sponsors'
def get_queryset(self, **kwargs):
queryset = super().get_queryset()
2017-07-15 14:04:26 +00:00
return queryset.filter(
tier__camp=self.camp
).order_by(
'tier__weight',
'name',
)
2016-12-28 23:15:13 +00:00