seminar | Pridan OtisknuteReseniNode, zakomentovany stare views.
This commit is contained in:
parent
1cec286697
commit
7cfb2c414e
3 changed files with 51 additions and 4 deletions
27
seminar/migrations/0078_otistenereseninode.py
Normal file
27
seminar/migrations/0078_otistenereseninode.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Generated by Django 2.2.9 on 2020-03-18 23:59
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('seminar', '0077_auto_20200318_2146'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='OtisteneReseniNode',
|
||||
fields=[
|
||||
('treenode_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='seminar.TreeNode')),
|
||||
('reseni', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Reseni', verbose_name='reseni')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Otištěné řešení (Node)',
|
||||
'verbose_name_plural': 'Otištěná řešení (Node)',
|
||||
'db_table': 'seminar_nodes_otistene_reseni',
|
||||
},
|
||||
bases=('seminar.treenode',),
|
||||
),
|
||||
]
|
|
@ -1474,6 +1474,26 @@ class CastNode(TreeNode):
|
|||
|
||||
nadpis = models.CharField('Nadpis', max_length=100, help_text = 'Nadpis podvěšené části obsahu')
|
||||
|
||||
def aktualizuj_nazev(self):
|
||||
self.nazev = "CastNode: "+str(self.nadpis)
|
||||
|
||||
def getOdkazStr(self):
|
||||
return str(self.nadpis)
|
||||
|
||||
class OtisteneReseniNode(TreeNode):
|
||||
class Meta:
|
||||
db_table = 'seminar_nodes_otistene_reseni'
|
||||
verbose_name = 'Otištěné řešení (Node)'
|
||||
verbose_name_plural = 'Otištěná řešení (Node)'
|
||||
reseni = models.ForeignKey(Reseni,
|
||||
on_delete=models.PROTECT,
|
||||
verbose_name = 'reseni')
|
||||
|
||||
def aktualizuj_nazev(self):
|
||||
self.nazev = "OtisteneReseniNode: "+str(self.reseni)
|
||||
|
||||
def getOdkazStr(self):
|
||||
return str(self.reseni)
|
||||
|
||||
## FIXME: Logiku přesunout do views.
|
||||
#class VysledkyBase(SeminarModelBase):
|
||||
|
|
|
@ -8,8 +8,8 @@ from django.contrib.auth import views as auth_views
|
|||
staff_member_required = user_passes_test(lambda u: u.is_staff)
|
||||
|
||||
urlpatterns = [
|
||||
path('aktualni/temata/', views.TemataRozcestnikView),
|
||||
path('<int:rocnik>/t<int:tematko>/', views.TematkoView),
|
||||
# path('aktualni/temata/', views.TemataRozcestnikView),
|
||||
# path('<int:rocnik>/t<int:tematko>/', views.TematkoView),
|
||||
|
||||
# REDIRECTy
|
||||
path('jak-resit/', RedirectView.as_view(url='/co-je-MaM/jak-resit/')),
|
||||
|
@ -60,8 +60,8 @@ urlpatterns = [
|
|||
),
|
||||
|
||||
# Zadani
|
||||
path('zadani/aktualni/', views.AktualniZadaniView, name='seminar_aktualni_zadani'),
|
||||
path('zadani/temata/', views.ZadaniTemataView, name='seminar_temata'),
|
||||
# path('zadani/aktualni/', views.AktualniZadaniView, name='seminar_aktualni_zadani'),
|
||||
# path('zadani/temata/', views.ZadaniTemataView, name='seminar_temata'),
|
||||
#path('zadani/vysledkova-listina/', views.ZadaniAktualniVysledkovkaView, name='seminar_vysledky'),
|
||||
path('stare-novinky/', views.StareNovinkyView.as_view(), name='stare_novinky'),
|
||||
|
||||
|
|
Loading…
Reference in a new issue