From 3c3b9f755a52c773c3f23006249b5cbac5d26ec2 Mon Sep 17 00:00:00 2001 From: Riki Date: Sat, 15 Jun 2024 23:35:46 +0200 Subject: [PATCH 1/3] Add `strana` column to `Clanek` Optionally add page fragment to `resitelske_clanky.html` --- ..._strana_alter_text_id_alter_treenode_id.py | 28 +++++++++++++++++++ seminar/models/tvorba.py | 2 ++ .../seminar/clanky/resitelske_clanky.html | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py diff --git a/seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py b/seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py new file mode 100644 index 00000000..cc6774d6 --- /dev/null +++ b/seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py @@ -0,0 +1,28 @@ +# Generated by Django 4.2.13 on 2024-06-15 21:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0129_novinky_post'), + ] + + operations = [ + migrations.AddField( + model_name='clanek', + name='strana', + field=models.PositiveIntegerField(blank=True, null=True, verbose_name='první strana'), + ), + migrations.AlterField( + model_name='text', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='treenode', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + ] diff --git a/seminar/models/tvorba.py b/seminar/models/tvorba.py index 1dd9db8e..4ef57bde 100644 --- a/seminar/models/tvorba.py +++ b/seminar/models/tvorba.py @@ -600,6 +600,8 @@ class Clanek(Problem): cislo = models.ForeignKey(Cislo, blank=True, null=True, on_delete=models.PROTECT, verbose_name='číslo vydání', related_name='vydane_clanky') + + strana = models.PositiveIntegerField(verbose_name="první strana", blank=True, null=True) @cached_property def kod_v_rocniku(self): diff --git a/seminar/templates/seminar/clanky/resitelske_clanky.html b/seminar/templates/seminar/clanky/resitelske_clanky.html index 2bcc7a6b..558232c0 100644 --- a/seminar/templates/seminar/clanky/resitelske_clanky.html +++ b/seminar/templates/seminar/clanky/resitelske_clanky.html @@ -17,7 +17,7 @@ {% endifchanged %}
  • {% if clanek.cislo.pdf %} - + {{ clanek.nazev }} ({% for r in clanek.reseni_set.first.resitele.all %}{{r}}{% if not forloop.last %}, {% endif %}{% endfor %}) From 6225630f9f949bdb812e8893aadb0bc5251bbeda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Thu, 20 Jun 2024 14:31:58 +0200 Subject: [PATCH 2/3] =?UTF-8?q?Migra=C4=8Dn=C3=AD=20kekel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t_id_alter_treenode_id.py => 0130_clanek_strana.py} | 10 ---------- 1 file changed, 10 deletions(-) rename seminar/migrations/{0130_clanek_strana_alter_text_id_alter_treenode_id.py => 0130_clanek_strana.py} (50%) diff --git a/seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py b/seminar/migrations/0130_clanek_strana.py similarity index 50% rename from seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py rename to seminar/migrations/0130_clanek_strana.py index cc6774d6..d2f985fb 100644 --- a/seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py +++ b/seminar/migrations/0130_clanek_strana.py @@ -15,14 +15,4 @@ class Migration(migrations.Migration): name='strana', field=models.PositiveIntegerField(blank=True, null=True, verbose_name='první strana'), ), - migrations.AlterField( - model_name='text', - name='id', - field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), - ), - migrations.AlterField( - model_name='treenode', - name='id', - field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), - ), ] From 1ce9cb445f66b7002937e6e4b8be64c17ae46bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Thu, 20 Jun 2024 14:38:27 +0200 Subject: [PATCH 3/3] =?UTF-8?q?Tady=20bylo=20=E2=80=9E.cislo=E2=80=9C=20na?= =?UTF-8?q?v=C3=ADc=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/templates/seminar/clanky/resitelske_clanky.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seminar/templates/seminar/clanky/resitelske_clanky.html b/seminar/templates/seminar/clanky/resitelske_clanky.html index 558232c0..0c808bda 100644 --- a/seminar/templates/seminar/clanky/resitelske_clanky.html +++ b/seminar/templates/seminar/clanky/resitelske_clanky.html @@ -17,7 +17,7 @@ {% endifchanged %}
  • {% if clanek.cislo.pdf %} - + {{ clanek.nazev }} ({% for r in clanek.reseni_set.first.resitele.all %}{{r}}{% if not forloop.last %}, {% endif %}{% endfor %})