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
|
|
|
|
|
|
|
|
2017-01-29 13:51:50 +00:00
|
|
|
class CallForSponsorsView(CampViewMixin, TemplateView):
|
|
|
|
def get_template_names(self):
|
2017-06-04 11:05:59 +00:00
|
|
|
return '%s_call_for_sponsors.html' % self.camp.slug
|