|
@ -122,26 +122,31 @@ class StareNovinkyView(generic.ListView): |
|
|
|
|
|
|
|
|
### Co je M&M |
|
|
### Co je M&M |
|
|
|
|
|
|
|
|
## Organizatori |
|
|
|
|
|
|
|
|
# Organizatori |
|
|
def aktivniOrganizatori(rok=date.today().year): |
|
|
def aktivniOrganizatori(rok=date.today().year): |
|
|
return Organizator.objects.exclude( |
|
|
return Organizator.objects.exclude( |
|
|
organizuje_do_roku__isnull=False, |
|
|
organizuje_do_roku__isnull=False, |
|
|
organizuje_do_roku__lt=rok |
|
|
organizuje_do_roku__lt=rok |
|
|
).order_by('user__first_name') |
|
|
).order_by('user__first_name') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CojemamOrganizatoriView(generic.ListView): |
|
|
class CojemamOrganizatoriView(generic.ListView): |
|
|
model = Organizator |
|
|
model = Organizator |
|
|
template_name='seminar/cojemam/organizatori.html' |
|
|
template_name = 'seminar/cojemam/organizatori.html' |
|
|
queryset = aktivniOrganizatori() |
|
|
queryset = aktivniOrganizatori() |
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
def get_context_data(self, **kwargs): |
|
|
context = super(CojemamOrganizatoriView, self).get_context_data(**kwargs) |
|
|
context = super(CojemamOrganizatoriView, self).get_context_data(**kwargs) |
|
|
context['aktivni'] = True |
|
|
context['aktivni'] = True |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CojemamOrganizatoriStariView(generic.ListView): |
|
|
class CojemamOrganizatoriStariView(generic.ListView): |
|
|
model = Organizator |
|
|
model = Organizator |
|
|
template_name='seminar/cojemam/organizatori.html' |
|
|
template_name = 'seminar/cojemam/organizatori.html' |
|
|
queryset = Organizator.objects.exclude(id__in = aktivniOrganizatori()).order_by('-organizuje_do_roku') |
|
|
queryset = Organizator.objects.exclude( |
|
|
|
|
|
id__in=aktivniOrganizatori()).order_by('-organizuje_do_roku') |
|
|
|
|
|
|
|
|
### Archiv |
|
|
### Archiv |
|
|
|
|
|
|
|
@ -807,24 +812,23 @@ def texDownloadView(request, rocnik, cislo): |
|
|
return JsonResponse(response) |
|
|
return JsonResponse(response) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Ceka na autocomplete v3 |
|
|
# Ceka na autocomplete v3 |
|
|
#class OrganizatorAutocomplete(autocomplete.Select2QuerySetView): |
|
|
# class OrganizatorAutocomplete(autocomplete.Select2QuerySetView): |
|
|
# def get_queryset(self): |
|
|
# def get_queryset(self): |
|
|
# if not self.request.user.is_authenticated(): |
|
|
# if not self.request.user.is_authenticated(): |
|
|
# return Organizator.objects.none() |
|
|
# return Organizator.objects.none() |
|
|
# |
|
|
# |
|
|
# qs = aktivniOrganizatori() |
|
|
# qs = aktivniOrganizatori() |
|
|
# |
|
|
# |
|
|
# if self.q: |
|
|
# if self.q: |
|
|
# if self.q[0] == "!": |
|
|
# if self.q[0] == "!": |
|
|
# qs = Organizator.objects.all() |
|
|
# qs = Organizator.objects.all() |
|
|
# query = self.q[1:] |
|
|
# query = self.q[1:] |
|
|
# else: |
|
|
# else: |
|
|
# query = self.q |
|
|
# query = self.q |
|
|
# qs = qs.filter( |
|
|
# qs = qs.filter( |
|
|
# Q(prezdivka__isstartswith=query)| |
|
|
# Q(prezdivka__isstartswith=query)| |
|
|
# Q(user__first_name__isstartswith=query)| |
|
|
# Q(user__first_name__isstartswith=query)| |
|
|
# Q(user__last_name__isstartswith=query)) |
|
|
# Q(user__last_name__isstartswith=query)) |
|
|
# |
|
|
# |
|
|
# return qs |
|
|
# return qs |
|
|