# Path: apps/ot/models/club.py
# class Club(models.Model):
#     """
#     동아리 정보
#     """
# 
#     class Meta:
#         verbose_name = '동아리 정보'
#         verbose_name_plural = '동아리 정보(들)'
# 
#     def __str__(self):
#         return str(self.name)
# 
#     name = models.CharField(
#         max_length=63,
#         verbose_name='동아리 이름',
#     )
#     pages = models.TextField(
#         blank=True,
#         verbose_name='동아리 페이스북/유튜브 페이지 주소',
#     )
#     one_line_intro = models.TextField(
#         blank=True,
#         verbose_name='동아리 한 줄 소개(메인 화면)',
#     )
#     intro = models.TextField(
#         verbose_name='동아리 소개',
#     )
#     is_band = models.BooleanField(
#         default=False,
#         verbose_name='밴드 여부',
#     )
# 
#     video_url1 = models.CharField(
#         blank=True,
#         max_length=63,
#         verbose_name='동아리 소개 비디오 주소 #1',
#     )
#     video_url2 = models.CharField(
#         blank=True,
#         max_length=63,
#         verbose_name='동아리 소개 비디오 주소 #2',
#     )
# 
# Path: apps/ot/util.py
# def vote_available(user):
#     if is_vote_period():
#         return is_freshman(user)
#     else:
#         return is_tester(user)


from django.views.generic import ListView, DetailView
from django.http import Http404
from django.shortcuts import redirect
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from ..models.club import Club
from ..util import vote_available




class ClubListView(ListView):
    template_name = 'club_list.html'
    context_object_name = 'clubs'

    def get_queryset(self):
        if 'is_band' in self.request.GET:
            if self.request.GET['is_band'] == '0':
                queryset = Club.objects.filter(is_band=False)
            elif self.request.GET['is_band'] == '1':

# Path: apps/ot/models/club.py
# class Club(models.Model):
#     """
#     동아리 정보
#     """
# 
#     class Meta:
#         verbose_name = '동아리 정보'
#         verbose_name_plural = '동아리 정보(들)'
# 
#     def __str__(self):
#         return str(self.name)
# 
#     name = models.CharField(
#         max_length=63,
#         verbose_name='동아리 이름',
#     )
#     pages = models.TextField(
#         blank=True,
#         verbose_name='동아리 페이스북/유튜브 페이지 주소',
#     )
#     one_line_intro = models.TextField(
#         blank=True,
#         verbose_name='동아리 한 줄 소개(메인 화면)',
#     )
#     intro = models.TextField(
#         verbose_name='동아리 소개',
#     )
#     is_band = models.BooleanField(
#         default=False,
#         verbose_name='밴드 여부',
#     )
# 
#     video_url1 = models.CharField(
#         blank=True,
#         max_length=63,
#         verbose_name='동아리 소개 비디오 주소 #1',
#     )
#     video_url2 = models.CharField(
#         blank=True,
#         max_length=63,
#         verbose_name='동아리 소개 비디오 주소 #2',
#     )
# 
# Path: apps/ot/util.py
# def vote_available(user):
#     if is_vote_period():
#         return is_freshman(user)
#     else:
#         return is_tester(user)


# Path: apps/ot/views/club.py
from django.views.generic import ListView, DetailView
from django.http import Http404
from django.shortcuts import redirect
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from ..models.club import Club
from ..util import vote_available





class ClubListView(ListView):
    template_name = 'club_list.html'
    context_object_name = 'clubs'

    def get_queryset(self):
        if 'is_band' in self.request.GET:
            if self.request.GET['is_band'] == '0':
                queryset = Club.objects.filter(is_band=False)
            elif self.request.GET['is_band'] == '1':

                queryset = Club.objects.filter(is_band=True)