Browse Source

Merge branch 'data_migrations' of gimli.ms.mff.cuni.cz:/akce/mam/git/mamweb into data_migrations

export_seznamu_prednasek
Anet 5 years ago
parent
commit
ec670a627e
  1. BIN
      Schema_new.dia
  2. 18
      seminar/migrations/0079_clanek_resitelsky.py
  3. 2
      seminar/models.py
  4. 2
      seminar/urls.py
  5. 29
      seminar/views/views_all.py

BIN
Schema_new.dia

Binary file not shown.

18
seminar/migrations/0079_clanek_resitelsky.py

@ -0,0 +1,18 @@
# Generated by Django 2.2.9 on 2020-03-25 19:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0078_otistenereseninode'),
]
operations = [
migrations.AddField(
model_name='clanek',
name='resitelsky',
field=models.BooleanField(default=True, verbose_name='Jde o řešitelský článek?'),
),
]

2
seminar/models.py

@ -754,6 +754,8 @@ class Clanek(Problem):
cislo = models.ForeignKey(Cislo, verbose_name='číslo', blank=True, null=True, cislo = models.ForeignKey(Cislo, verbose_name='číslo', blank=True, null=True,
on_delete=models.PROTECT) on_delete=models.PROTECT)
resitelsky = models.BooleanField('Jde o řešitelský článek?', default=True)
# má OneToOneField s: # má OneToOneField s:
# ClanekNode # ClanekNode

2
seminar/urls.py

@ -60,7 +60,7 @@ urlpatterns = [
), ),
# Zadani # Zadani
# path('zadani/aktualni/', views.AktualniZadaniView, name='seminar_aktualni_zadani'), path('zadani/aktualni/', views.AktualniZadaniView.as_view(), name='seminar_aktualni_zadani'),
# path('zadani/temata/', views.ZadaniTemataView, name='seminar_temata'), # path('zadani/temata/', views.ZadaniTemataView, name='seminar_temata'),
#path('zadani/vysledkova-listina/', views.ZadaniAktualniVysledkovkaView, name='seminar_vysledky'), #path('zadani/vysledkova-listina/', views.ZadaniAktualniVysledkovkaView, name='seminar_vysledky'),
path('stare-novinky/', views.StareNovinkyView.as_view(), name='stare_novinky'), path('stare-novinky/', views.StareNovinkyView.as_view(), name='stare_novinky'),

29
seminar/views/views_all.py

@ -106,21 +106,18 @@ class TreeNodeView(generic.DetailView):
return context return context
#def AktualniZadaniView(request): class AktualniZadaniView(TreeNodeView):
# nastaveni = get_object_or_404(Nastaveni) def get_object(self):
# verejne = nastaveni.aktualni_cislo.verejne() nastaveni = get_object_or_404(Nastaveni)
# problemy = Problem.objects.filter(cislo_zadani=nastaveni.aktualni_cislo).filter(stav = 'zadany') return nastaveni.aktualni_cislo.cislonode
# ulohy = problemy.filter(typ = 'uloha').order_by('kod')
# serialy = problemy.filter(typ = 'serial').order_by('kod') def get_context_data(self,**kwargs):
# jednorazove_problemy = [ulohy, serialy] nastaveni = get_object_or_404(Nastaveni)
# return render(request, 'seminar/zadani/AktualniZadani.html', context = super().get_context_data(**kwargs)
# {'nastaveni': nastaveni, verejne = nastaveni.aktualni_cislo.verejne()
# 'jednorazove_problemy': jednorazove_problemy, context['verejne'] = verejne
# 'temata': verejna_temata(nastaveni.aktualni_rocnik), return context
# 'verejne': verejne,
# },
# )
#
#def ZadaniTemataView(request): #def ZadaniTemataView(request):
# nastaveni = get_object_or_404(Nastaveni) # nastaveni = get_object_or_404(Nastaveni)
# temata = verejna_temata(nastaveni.aktualni_rocnik) # temata = verejna_temata(nastaveni.aktualni_rocnik)
@ -1009,7 +1006,7 @@ def soustredeniUcastniciExportView(request,soustredeni):
class ClankyResitelView(generic.ListView): class ClankyResitelView(generic.ListView):
model = Problem model = Problem
template_name = 'seminar/clanky/resitelske_clanky.html' template_name = 'seminar/clanky/resitelske_clanky.html'
queryset = Clanek.objects.filter(stav=Problem.STAV_ZADANY).select_related('cislo_zadani__rocnik').order_by('-cislo_zadani__rocnik__rocnik', 'kod') queryset = Clanek.objects.filter(stav=Problem.STAV_ZADANY, resitelsky=True).select_related('cislo__rocnik').order_by('-cislo__rocnik__rocnik', 'kod')
# FIXME: pokud chceme orgoclanky, tak nejak zavest do modelu a podle toho odkomentovat a upravit # FIXME: pokud chceme orgoclanky, tak nejak zavest do modelu a podle toho odkomentovat a upravit
#class ClankyOrganizatorView(generic.ListView)<F12>: #class ClankyOrganizatorView(generic.ListView)<F12>:

Loading…
Cancel
Save