Podezřelé semináře (#1465) #65
podezrele-seminare
into master
1 week ago
@ -1,6 +1,4 @@ |
|||||
""" |
""" |
||||
Zde bývalo vše. Teď tu zbývají všechny modely a části webu jako archiv, |
Zde bývalo vše. Teď tu zbývají migrace. |
||||
přehled orgů, aktuální (k aktuálnímu číslu) věci, titulka a jak řešit. |
A kód pro `import seminar.models as m` pro ./manage.py shell. |
||||
|
|
||||
Také je tu generování testovacích (lokálních) dat. |
|
||||
""" |
""" |
@ -0,0 +1,15 @@ |
|||||
|
# Tento soubor slouží pouze pro shell a podobné. Nikde neimportovat v kódu! |
||||
|
|
||||
|
print("Naimportoval jsi `seminar.models`. Pevně věřím, že to nebylo nikde v kódu. Díky.") |
||||
|
|
||||
|
from galerie.models import * |
||||
|
from header_fotky.models import * |
||||
|
from korektury.models import * |
||||
|
from novinky.models import * |
||||
|
from odevzdavatko.models import * |
||||
|
from personalni.models import * |
||||
|
from prednasky.models import * |
||||
|
from soustredeni.models import * |
||||
|
from treenode.models import * |
||||
|
from tvorba.models import * |
||||
|
from various.models import * |
@ -1,21 +0,0 @@ |
|||||
from .tvorba import * |
|
||||
from .base import * |
|
||||
|
|
||||
from various.models import Nastaveni |
|
||||
from personalni.models import Organizator, Resitel, Skola, Prijemce, Osoba |
|
||||
from soustredeni.models import Soustredeni, Soustredeni_Ucastnici, Soustredeni_Organizatori, Konfera, Konfery_Ucastnici |
|
||||
from novinky.models import Novinky |
|
||||
from odevzdavatko.models import Reseni, PrilohaReseni, Reseni_Resitele, Hodnoceni |
|
||||
from tvorba.models import ZmrazenaVysledkovka, Deadline, Cislo, Rocnik, Pohadka, Tema, Problem, Problemy_Opravovatele, Uloha, Clanek |
|
||||
from treenode.models import UlohaVzorakNode, UlohaZadaniNode, CisloNode, TemaVCisleNode, OrgTextNode, Obrazek, RocnikNode, PohadkaNode, TextNode, MezicisloNode, ReseniNode, CastNode, Text, TreeNode |
|
||||
|
|
||||
# Kvůli migr. 0041 |
|
||||
from soustredeni.models import generate_filename_konfera |
|
||||
# migr. 0001 |
|
||||
from odevzdavatko.models import generate_filename |
|
||||
# migr. 0031, 0032, 0081 |
|
||||
from tvorba.models import cislo_pdf_filename |
|
||||
# migr. 0082 |
|
||||
from tvorba.models import cislo_png_filename |
|
||||
# migr 0100 (hack) |
|
||||
import tvorba.models as tvorba |
|
@ -1,23 +0,0 @@ |
|||||
from django.urls import reverse |
|
||||
from django.db import models |
|
||||
|
|
||||
|
|
||||
class SeminarModelBase(models.Model): |
|
||||
|
|
||||
class Meta: |
|
||||
abstract = True |
|
||||
|
|
||||
def verejne(self): |
|
||||
return False |
|
||||
|
|
||||
# def get_absolute_url(self): |
|
||||
# return "https://" + str(get_current_site(None)) + self.verejne_url() |
|
||||
|
|
||||
def admin_url(self): |
|
||||
app_name = self._meta.app_label |
|
||||
model_name = self._meta.model_name |
|
||||
return reverse('admin:{}_{}_change'.format(app_name, model_name), args=(self.id, )) |
|
||||
|
|
||||
# def verejne_url(self): |
|
||||
# return None |
|
||||
|
|
@ -1,14 +0,0 @@ |
|||||
import os |
|
||||
import logging |
|
||||
|
|
||||
from django.core.files.storage import FileSystemStorage |
|
||||
|
|
||||
logger = logging.getLogger(__name__) |
|
||||
|
|
||||
class OverwriteStorage(FileSystemStorage): |
|
||||
""" Varianta FileSystemStorage, která v případě, že soubor cílového |
|
||||
jména již existuje, ho smaže a místo něj uloží soubor nový""" |
|
||||
def get_available_name(self,name, max_length=None): |
|
||||
if self.exists(name): |
|
||||
os.remove(os.path.join(self.location,name)) |
|
||||
return super().get_available_name(name,max_length) |
|
@ -1,6 +1,6 @@ |
|||||
from django import template |
from django import template |
||||
from enum import Enum |
from enum import Enum |
||||
import seminar.models as m |
from .models import RocnikNode, CisloNode, CastNode, TextNode, TemaVCisleNode, UlohaVzorakNode, UlohaZadaniNode, PohadkaNode |
||||
ledoian
commented 2 weeks ago
Review
(Těchto TreeNodů je tu málo, ale nechce se mi teď zjišťovat, které tři chybí…) |
|||||
|
|
||||
register = template.Library() |
register = template.Library() |
||||
|
|
||||
@ -11,8 +11,8 @@ def nodeType(value): |
|||||
if isinstance(value,CastNode): return "Část" |
if isinstance(value,CastNode): return "Část" |
||||
if isinstance(value,TextNode): return "Text" |
if isinstance(value,TextNode): return "Text" |
||||
if isinstance(value,TemaVCisleNode): return "Téma v čísle" |
if isinstance(value,TemaVCisleNode): return "Téma v čísle" |
||||
if isinstance(value,KonferaNode): return "Konfera" |
# if isinstance(value,KonferaNode): return "Konfera" # FIXME neexistuje |
||||
if isinstance(value,ClanekNode): return "Článek" |
# if isinstance(value,ClanekNode): return "Článek" # FIXME neexistuje |
||||
ledoian
commented 2 weeks ago
Review
Tyhle komentáře způsobí tiché spadnutí. Byl by to
zelvuska
commented 1 week ago
Review
To je asi otázka spíš na to, proč KonferaNode a ClanekNode přestalo existovat a proč s tím nepřestal existovat i tento kód… |
|||||
if isinstance(value,UlohaVzorakNode): return "Vzorák" |
if isinstance(value,UlohaVzorakNode): return "Vzorák" |
||||
if isinstance(value,UlohaZadaniNode): return "Zadání úlohy" |
if isinstance(value,UlohaZadaniNode): return "Zadání úlohy" |
||||
if isinstance(value,PohadkaNode): return "Pohádka" |
if isinstance(value,PohadkaNode): return "Pohádka" |
||||
@ -22,53 +22,57 @@ def nodeType(value): |
|||||
|
|
||||
@register.filter |
@register.filter |
||||
def isRocnik(value): |
def isRocnik(value): |
||||
return isinstance(value, m.RocnikNode) |
return isinstance(value, RocnikNode) |
||||
|
|
||||
@register.filter |
@register.filter |
||||
def isCislo(value): |
def isCislo(value): |
||||
return isinstance(value, m.CisloNode) |
return isinstance(value, CisloNode) |
||||
|
|
||||
@register.filter |
@register.filter |
||||
def isCast(value): |
def isCast(value): |
||||
return isinstance(value, m.CastNode) |
return isinstance(value, CastNode) |
||||
|
|
||||
@register.filter |
@register.filter |
||||
def isText(value): |
def isText(value): |
||||
return isinstance(value, m.TextNode) |
return isinstance(value, TextNode) |
||||
|
|
||||
@register.filter |
@register.filter |
||||
def isTemaVCisle(value): |
def isTemaVCisle(value): |
||||
return isinstance(value, m.TemaVCisleNode) |
return isinstance(value, TemaVCisleNode) |
||||
|
|
||||
@register.filter |
@register.filter |
||||
def isKonfera(value): |
def isKonfera(value): |
||||
return isinstance(value, m.KonferaNode) |
# FIXME neexistuje |
||||
|
# return isinstance(value, KonferaNode) |
||||
ledoian
commented 2 weeks ago
Review
Prosím aspoň zalogovat, neumřít tiše.
zelvuska
commented 1 week ago
Review
Stejně jako výše. KonferaNode prostě neexistuje. (Přestala existovat v migraci 0080, které jsi autor…) |
|||||
|
return False |
||||
|
|
||||
@register.filter |
@register.filter |
||||
def isClanek(value): |
def isClanek(value): |
||||
return isinstance(value, m.ClanekNode) |
# FIXME neexistuje |
||||
|
# return isinstance(value, ClanekNode) |
||||
|
return False |
||||
|
|
||||
@register.filter |
@register.filter |
||||
def isUlohaVzorak(value): |
def isUlohaVzorak(value): |
||||
return isinstance(value, m.UlohaVzorakNode) |
return isinstance(value, UlohaVzorakNode) |
||||
|
|
||||
@register.filter |
@register.filter |
||||
def isUlohaZadani(value): |
def isUlohaZadani(value): |
||||
return isinstance(value, m.UlohaZadaniNode) |
return isinstance(value, UlohaZadaniNode) |
||||
|
|
||||
@register.filter |
@register.filter |
||||
def isPohadka(value): |
def isPohadka(value): |
||||
return isinstance(value, m.PohadkaNode) |
return isinstance(value, PohadkaNode) |
||||
|
|
||||
@register.filter |
@register.filter |
||||
def isReseni(value): |
def isReseni(value): |
||||
return False |
return False |
||||
# return isinstance(value, m.OtisteneReseniNode) |
# return isinstance(value, OtisteneReseniNode) |
||||
|
|
||||
@register.filter |
@register.filter |
||||
def isOrgText(value): |
def isOrgText(value): |
||||
return False |
return False |
||||
# return isinstance(value, m.OrgTextNode) |
# return isinstance(value, OrgTextNode) |
||||
|
|
||||
|
|
||||
### |
### |
||||
|
@ -1,16 +1,16 @@ |
|||||
from django.test import TestCase |
from django.test import TestCase |
||||
import treenode.treelib as tl |
import treenode.treelib as tl |
||||
import seminar.models as m |
from .models import CastNode |
||||
ledoian
commented 2 weeks ago
Review
V principu myslím, že tady je lepší řešení spíš
zelvuska
commented 1 week ago
Review
Proč si myslíš, že je lepší náhodná zkratka, než importování přímo věcí (když je to lokální věc). A celkově nad tímhle (jak má vypadat importování toho všeho, co předtím bylo |
|||||
|
|
||||
class SimpleTreeLibTests(TestCase): |
class SimpleTreeLibTests(TestCase): |
||||
def setUp(self): |
def setUp(self): |
||||
# Vyrobíme pár nějakých Nodů |
# Vyrobíme pár nějakých Nodů |
||||
self.root = m.CastNode(root=None, first_child=None, succ=None, nadpis="Root") |
self.root = CastNode(root=None, first_child=None, succ=None, nadpis="Root") |
||||
self.root.save() |
self.root.save() |
||||
self.some_node = m.CastNode(root=self.root, first_child=None, succ=None, nadpis="Přetržené") |
self.some_node = CastNode(root=self.root, first_child=None, succ=None, nadpis="Přetržené") |
||||
self.other_node = m.CastNode(root=self.root, first_child=None, succ=None, nadpis="Dítě") |
self.other_node = CastNode(root=self.root, first_child=None, succ=None, nadpis="Dítě") |
||||
self.some_orphan = m.CastNode(root=None, first_child=None, succ=None, nadpis="Ošklivé") |
self.some_orphan = CastNode(root=None, first_child=None, succ=None, nadpis="Ošklivé") |
||||
self.other_orphan = m.CastNode(root=None, first_child=None, succ=None, nadpis="Káčátko") |
self.other_orphan = CastNode(root=None, first_child=None, succ=None, nadpis="Káčátko") |
||||
|
|
||||
# Trochu je pospojujeme |
# Trochu je pospojujeme |
||||
self.root.first_child = self.some_node |
self.root.first_child = self.some_node |
||||
|
@ -6,8 +6,8 @@ from django.views.generic.edit import CreateView |
|||||
from django.contrib.auth.mixins import LoginRequiredMixin |
from django.contrib.auth.mixins import LoginRequiredMixin |
||||
from django.core.exceptions import PermissionDenied |
from django.core.exceptions import PermissionDenied |
||||
|
|
||||
import seminar.models as s |
from .models import TemaVCisleNode, RocnikNode, CisloNode, UlohaVzorakNode, UlohaZadaniNode, TreeNode, CastNode, TextNode, ReseniNode, PohadkaNode, OrgTextNode |
||||
ledoian
commented 2 weeks ago
Review
(Tu chybí
zelvuska
commented 1 week ago
Review
Asi nejsem schopen opravit (aniž bych se snažil pochopit treenode). |
|||||
import seminar.models as m |
from .models import Text, Obrazek |
||||
from treenode import treelib |
from treenode import treelib |
||||
import treenode.forms as f |
import treenode.forms as f |
||||
import treenode.templatetags as tnltt |
import treenode.templatetags as tnltt |
||||
@ -29,7 +29,7 @@ class TNLData(object): |
|||||
|
|
||||
if parent: |
if parent: |
||||
self.tema_in_path = parent.tema_in_path |
self.tema_in_path = parent.tema_in_path |
||||
if isinstance(anode, m.TemaVCisleNode): |
if isinstance(anode, TemaVCisleNode): |
||||
self.tema_in_path = True |
self.tema_in_path = True |
||||
|
|
||||
def add_edit_options(self): |
def add_edit_options(self): |
||||
@ -51,11 +51,11 @@ class TNLData(object): |
|||||
(All of them have method verejne.)""" |
(All of them have method verejne.)""" |
||||
parent = anode # chceme začít už od konkrétního node včetně |
parent = anode # chceme začít už od konkrétního node včetně |
||||
while True: |
while True: |
||||
rocnik = isinstance(parent, s.RocnikNode) |
rocnik = isinstance(parent, RocnikNode) |
||||
cislo = isinstance(parent, s.CisloNode) |
cislo = isinstance(parent, CisloNode) |
||||
uloha = (isinstance(parent, s.UlohaVzorakNode) or |
uloha = (isinstance(parent, UlohaVzorakNode) or |
||||
isinstance(parent, s.UlohaZadaniNode)) |
isinstance(parent, UlohaZadaniNode)) |
||||
tema = isinstance(parent, s.TemaVCisleNode) |
tema = isinstance(parent, TemaVCisleNode) |
||||
|
|
||||
if (rocnik or cislo or uloha or tema) or parent==None: |
if (rocnik or cislo or uloha or tema) or parent==None: |
||||
break |
break |
||||
@ -158,7 +158,7 @@ class TNLData(object): |
|||||
|
|
||||
|
|
||||
class TreeNodeView(generic.DetailView): |
class TreeNodeView(generic.DetailView): |
||||
model = s.TreeNode |
model = TreeNode |
||||
template_name = 'treenode/treenode.html' |
template_name = 'treenode/treenode.html' |
||||
|
|
||||
def get_context_data(self,**kwargs): |
def get_context_data(self,**kwargs): |
||||
@ -168,7 +168,7 @@ class TreeNodeView(generic.DetailView): |
|||||
|
|
||||
|
|
||||
class TreeNodeJSONView(generic.DetailView): |
class TreeNodeJSONView(generic.DetailView): |
||||
model = s.TreeNode |
model = TreeNode |
||||
|
|
||||
def get(self,request,*args, **kwargs): |
def get(self,request,*args, **kwargs): |
||||
self.object = self.get_object() |
self.object = self.get_object() |
||||
@ -178,21 +178,21 @@ class TreeNodeJSONView(generic.DetailView): |
|||||
|
|
||||
class TreeNodePridatView(generic.View): |
class TreeNodePridatView(generic.View): |
||||
type_from_str = { |
type_from_str = { |
||||
'rocnikNode': m.RocnikNode, |
'rocnikNode': RocnikNode, |
||||
'cisloNode': m.CisloNode, |
'cisloNode': CisloNode, |
||||
'castNode': m.CastNode, |
'castNode': CastNode, |
||||
'textNode': m.TextNode, |
'textNode': TextNode, |
||||
'temaVCisleNode': m.TemaVCisleNode, |
'temaVCisleNode': TemaVCisleNode, |
||||
'reseniNode': m.ReseniNode, |
'reseniNode': ReseniNode, |
||||
'ulohaZadaniNode': m.UlohaZadaniNode, |
'ulohaZadaniNode': UlohaZadaniNode, |
||||
'ulohaVzorakNode': m.UlohaVzorakNode, |
'ulohaVzorakNode': UlohaVzorakNode, |
||||
'pohadkaNode': m.PohadkaNode, |
'pohadkaNode': PohadkaNode, |
||||
'orgText': m.OrgTextNode, |
'orgText': OrgTextNode, |
||||
} |
} |
||||
|
|
||||
def post(self, request, *args, **kwargs): |
def post(self, request, *args, **kwargs): |
||||
######## FIXME: ROZEPSANE, NEFUNGUJE, DOPSAT !!!!!! ########### |
######## FIXME: ROZEPSANE, NEFUNGUJE, DOPSAT !!!!!! ########### |
||||
node = s.TreeNode.objects.get(pk=self.kwargs['pk']) |
node = TreeNode.objects.get(pk=self.kwargs['pk']) |
||||
kam = self.kwargs['kam'] |
kam = self.kwargs['kam'] |
||||
co = self.kwargs['co'] |
co = self.kwargs['co'] |
||||
typ = self.type_from_str[co] |
typ = self.type_from_str[co] |
||||
@ -202,19 +202,19 @@ class TreeNodePridatView(generic.View): |
|||||
if kam not in ('pred','syn','za'): |
if kam not in ('pred','syn','za'): |
||||
raise ValidationError('Přidat lze pouze před nebo za node nebo jako syna') |
raise ValidationError('Přidat lze pouze před nebo za node nebo jako syna') |
||||
|
|
||||
if co == m.TextNode: |
if co == TextNode: |
||||
new_obj = m.Text() |
new_obj = Text() |
||||
new_obj.save() |
new_obj.save() |
||||
elif co == m.CastNode: |
elif co == CastNode: |
||||
new_obj = m.CastNode() |
new_obj = CastNode() |
||||
new_obj.nadpis = request.POST.get('pridat-castNode-{}-{}'.format(node.id,kam)) |
new_obj.nadpis = request.POST.get('pridat-castNode-{}-{}'.format(node.id,kam)) |
||||
new_obj.save() |
new_obj.save() |
||||
elif co == m.ReseniNode: |
elif co == ReseniNode: |
||||
new_obj = m |
new_obj = m |
||||
pass |
pass |
||||
elif co == m.UlohaZadaniNode: |
elif co == UlohaZadaniNode: |
||||
pass |
pass |
||||
elif co == m.UlohaReseniNode: |
elif co == UlohaReseniNode: |
||||
pass |
pass |
||||
else: |
else: |
||||
new_obj = None |
new_obj = None |
||||
@ -225,15 +225,15 @@ class TreeNodePridatView(generic.View): |
|||||
|
|
||||
|
|
||||
if kam == 'syn': |
if kam == 'syn': |
||||
if typ == m.TextNode: |
if typ == TextNode: |
||||
text_obj = m.Text() |
text_obj = Text() |
||||
text_obj.save() |
text_obj.save() |
||||
node = treelib.create_child(node, typ, text=text_obj) |
node = treelib.create_child(node, typ, text=text_obj) |
||||
else: |
else: |
||||
node = treelib.create_child(node, typ) |
node = treelib.create_child(node, typ) |
||||
if kam == 'za': |
if kam == 'za': |
||||
if typ == m.TextNode: |
if typ == TextNode: |
||||
text_obj = m.Text() |
text_obj = Text() |
||||
text_obj.save() |
text_obj.save() |
||||
node = treelib.create_node_after(node, typ, text=text_obj) |
node = treelib.create_node_after(node, typ, text=text_obj) |
||||
else: |
else: |
||||
@ -244,7 +244,7 @@ class TreeNodePridatView(generic.View): |
|||||
|
|
||||
class TreeNodeSmazatView(generic.base.View): |
class TreeNodeSmazatView(generic.base.View): |
||||
def post(self, request, *args, **kwargs): |
def post(self, request, *args, **kwargs): |
||||
node = s.TreeNode.objects.get(pk=self.kwargs['pk']) |
node = TreeNode.objects.get(pk=self.kwargs['pk']) |
||||
if node.first_child: |
if node.first_child: |
||||
raise NotImplementedError('Mazání TreeNode se syny není zatím podporováno!') |
raise NotImplementedError('Mazání TreeNode se syny není zatím podporováno!') |
||||
treelib.disconnect_node(node) |
treelib.disconnect_node(node) |
||||
@ -254,7 +254,7 @@ class TreeNodeSmazatView(generic.base.View): |
|||||
|
|
||||
class TreeNodeOdvesitPrycView(generic.base.View): |
class TreeNodeOdvesitPrycView(generic.base.View): |
||||
def post(self, request, *args, **kwargs): |
def post(self, request, *args, **kwargs): |
||||
node = s.TreeNode.objects.get(pk=self.kwargs['pk']) |
node = TreeNode.objects.get(pk=self.kwargs['pk']) |
||||
treelib.disconnect_node(node) |
treelib.disconnect_node(node) |
||||
node.root = None |
node.root = None |
||||
node.save() |
node.save() |
||||
@ -263,7 +263,7 @@ class TreeNodeOdvesitPrycView(generic.base.View): |
|||||
|
|
||||
class TreeNodePodvesitView(generic.base.View): |
class TreeNodePodvesitView(generic.base.View): |
||||
def post(self, request, *args, **kwargs): |
def post(self, request, *args, **kwargs): |
||||
node = s.TreeNode.objects.get(pk=self.kwargs['pk']) |
node = TreeNode.objects.get(pk=self.kwargs['pk']) |
||||
kam = self.kwargs['kam'] |
kam = self.kwargs['kam'] |
||||
if kam == 'pred': |
if kam == 'pred': |
||||
treelib.lower_node(node) |
treelib.lower_node(node) |
||||
@ -274,21 +274,21 @@ class TreeNodePodvesitView(generic.base.View): |
|||||
|
|
||||
class TreeNodeProhoditView(generic.base.View): |
class TreeNodeProhoditView(generic.base.View): |
||||
def post(self, request, *args, **kwargs): |
def post(self, request, *args, **kwargs): |
||||
node = s.TreeNode.objects.get(pk=self.kwargs['pk']) |
node = TreeNode.objects.get(pk=self.kwargs['pk']) |
||||
treelib.swap_succ(node) |
treelib.swap_succ(node) |
||||
return redirect(request.headers.get('referer')) |
return redirect(request.headers.get('referer')) |
||||
#FIXME ve formulari predat puvodni url a vratit redirect na ni |
#FIXME ve formulari predat puvodni url a vratit redirect na ni |
||||
|
|
||||
class SirotcinecView(generic.ListView): |
class SirotcinecView(generic.ListView): |
||||
model = s.TreeNode |
model = TreeNode |
||||
template_name = 'treenode/orphanage.html' |
template_name = 'treenode/orphanage.html' |
||||
|
|
||||
def get_queryset(self): |
def get_queryset(self): |
||||
return s.TreeNode.objects.not_instance_of(s.RocnikNode).filter(root=None,prev=None,succ=None,father_of_first=None) |
return TreeNode.objects.not_instance_of(RocnikNode).filter(root=None,prev=None,succ=None,father_of_first=None) |
||||
|
|
||||
# FIXME pouzit Django REST Framework |
# FIXME pouzit Django REST Framework |
||||
class TextWebView(generic.DetailView): |
class TextWebView(generic.DetailView): |
||||
model = s.Text |
model = Text |
||||
|
|
||||
def get(self,request,*args, **kwargs): |
def get(self,request,*args, **kwargs): |
||||
self.object = self.get_object() |
self.object = self.get_object() |
||||
@ -300,7 +300,7 @@ class VueTestView(generic.TemplateView): |
|||||
|
|
||||
|
|
||||
class NahrajObrazekKTreeNoduView(LoginRequiredMixin, CreateView): |
class NahrajObrazekKTreeNoduView(LoginRequiredMixin, CreateView): |
||||
model = s.Obrazek |
model = Obrazek |
||||
form_class = f.NahrajObrazekKTreeNoduForm |
form_class = f.NahrajObrazekKTreeNoduForm |
||||
|
|
||||
def get_initial(self): |
def get_initial(self): |
||||
@ -316,7 +316,7 @@ class NahrajObrazekKTreeNoduView(LoginRequiredMixin, CreateView): |
|||||
print(form) |
print(form) |
||||
self.object = form.save(commit=False) |
self.object = form.save(commit=False) |
||||
print(self.object.na_web) |
print(self.object.na_web) |
||||
self.object.text = m.Text.objects.get(pk=int(self.request.headers['Textid'])) |
self.object.text = Text.objects.get(pk=int(self.request.headers['Textid'])) |
||||
self.object.save() |
self.object.save() |
||||
|
|
||||
return JsonResponse({"url":self.object.na_web.url}) |
return JsonResponse({"url":self.object.na_web.url}) |
||||
|
@ -1,11 +1,11 @@ |
|||||
from django.core.management.base import BaseCommand |
from django.core.management.base import BaseCommand |
||||
import seminar.models as m |
from tvorba.models import Deadline |
||||
|
|
||||
|
|
||||
class Command(BaseCommand): |
class Command(BaseCommand): |
||||
help = "Všem deadlinům se zveřejněnou výsledkovkou vygeneruj výsledkovku" |
help = "Všem deadlinům se zveřejněnou výsledkovkou vygeneruj výsledkovku" |
||||
|
|
||||
def handle(self, *args, **options): |
def handle(self, *args, **options): |
||||
for deadline in m.Deadline.objects.filter(verejna_vysledkovka=True): |
for deadline in Deadline.objects.filter(verejna_vysledkovka=True): |
||||
deadline.vygeneruj_vysledkovku() |
deadline.vygeneruj_vysledkovku() |
||||
|
|
||||
|