21 changed files with 189 additions and 7 deletions
@ -0,0 +1,5 @@ |
|||||
|
from django.contrib import admin |
||||
|
|
||||
|
from .models import Novinky |
||||
|
|
||||
|
admin.site.register(Novinky) |
@ -0,0 +1,5 @@ |
|||||
|
from django.apps import AppConfig |
||||
|
|
||||
|
class NovinkyConfig(AppConfig): |
||||
|
default_auto_field = 'django.db.models.BigAutoField' |
||||
|
name = 'novinky' |
@ -0,0 +1,45 @@ |
|||||
|
# Generated by Django 4.2.13 on 2024-05-13 20:43 |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
|
||||
|
def nastav_nove_contenttypes(apps, schema_editor): |
||||
|
ContentType = apps.get_model('contenttypes', 'ContentType') |
||||
|
for m in ('novinka'): |
||||
|
oct = ContentType.objects.filter(app_label='seminar', model=m) |
||||
|
oct.update(app_label='novinky') |
||||
|
|
||||
|
def nastav_stare_contenttypes(apps, schema_editor): |
||||
|
ContentType = apps.get_model('contenttypes', 'ContentType') |
||||
|
for m in ('novinka'): |
||||
|
nct = ContentType.objects.filter(app_label='novinky', model=m) |
||||
|
nct.update(app_label='seminar') |
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
initial = True |
||||
|
|
||||
|
dependencies = [ |
||||
|
('seminar', '0127_unmanage_novinky'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.RunPython(nastav_nove_contenttypes, nastav_stare_contenttypes), |
||||
|
migrations.CreateModel( |
||||
|
name='Novinky', |
||||
|
fields=[ |
||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
||||
|
('datum', models.DateField(auto_now_add=True)), |
||||
|
('text', models.TextField(blank=True, null=True, verbose_name='Text novinky')), |
||||
|
('obrazek', models.ImageField(blank=True, null=True, upload_to='image_novinky/%Y/%m/%d/', verbose_name='Obrázek')), |
||||
|
('autor', models.ForeignKey(to='personalni.organizator', verbose_name='Autor novinky', null=True, on_delete=models.SET_NULL)), |
||||
|
('zverejneno', models.BooleanField(default=False, verbose_name='Zveřejněno')), |
||||
|
], |
||||
|
options={ |
||||
|
'verbose_name': 'Novinka', |
||||
|
'verbose_name_plural': 'Novinky', |
||||
|
'db_table': 'seminar_novinky', |
||||
|
'ordering': ['-datum'], |
||||
|
'managed': False, |
||||
|
}, |
||||
|
), |
||||
|
] |
@ -0,0 +1,18 @@ |
|||||
|
# Generated by Django 4.2.13 on 2024-05-13 20:58 |
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('novinky', '0001_initial'), |
||||
|
('seminar', '0128_delete_novinky'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterModelOptions( |
||||
|
name='novinky', |
||||
|
options={'ordering': ['-datum'], 'verbose_name': 'Novinka', 'verbose_name_plural': 'Novinky'}, |
||||
|
), |
||||
|
] |
@ -0,0 +1,13 @@ |
|||||
|
# Generated by Django 4.2.13 on 2024-05-13 21:00 |
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('novinky', '0002_manage_novinky'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
] |
@ -0,0 +1,3 @@ |
|||||
|
from django.test import TestCase |
||||
|
|
||||
|
# Create your tests here. |
@ -0,0 +1,3 @@ |
|||||
|
from django.shortcuts import render |
||||
|
|
||||
|
# Create your views here. |
@ -0,0 +1,13 @@ |
|||||
|
# Generated by Django 4.2.13 on 2024-05-13 20:35 |
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('personalni', '0006_pre_split_soustredeni'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
] |
@ -0,0 +1,14 @@ |
|||||
|
# Generated by Django 4.2.13 on 2024-05-13 20:59 |
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('personalni', '0007_novinky_pre'), |
||||
|
('novinky', '0003_novinky_post'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
] |
@ -0,0 +1,14 @@ |
|||||
|
# Generated by Django 4.2.13 on 2024-05-13 20:36 |
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('seminar', '0125_post_split_soustredeni'), |
||||
|
('personalni', '0007_novinky_pre'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
] |
@ -0,0 +1,17 @@ |
|||||
|
# Generated by Django 4.2.13 on 2024-05-13 20:41 |
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('seminar', '0126_novinky_pre'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterModelOptions( |
||||
|
name='novinky', |
||||
|
options={'managed': False, 'ordering': ['-datum'], 'verbose_name': 'Novinka', 'verbose_name_plural': 'Novinky'}, |
||||
|
), |
||||
|
] |
@ -0,0 +1,17 @@ |
|||||
|
# Generated by Django 4.2.13 on 2024-05-13 20:54 |
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('seminar', '0127_unmanage_novinky'), |
||||
|
('novinky', '0001_initial'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.DeleteModel( |
||||
|
name='Novinky', |
||||
|
), |
||||
|
] |
@ -0,0 +1,14 @@ |
|||||
|
# Generated by Django 4.2.13 on 2024-05-13 20:59 |
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('seminar', '0128_delete_novinky'), |
||||
|
('novinky', '0003_novinky_post'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
] |
Loading…
Reference in new issue