From 731c795ee68fd814ae23edea4659ca3884dd7726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sun, 4 Aug 2024 19:01:09 +0200 Subject: [PATCH] Text a Obrazek --- seminar/admin.py | 20 -------------------- treenode/admin.py | 11 +++++++++++ tvorba/admin.py | 4 ++-- 3 files changed, 13 insertions(+), 22 deletions(-) delete mode 100644 seminar/admin.py diff --git a/seminar/admin.py b/seminar/admin.py deleted file mode 100644 index b806edab..00000000 --- a/seminar/admin.py +++ /dev/null @@ -1,20 +0,0 @@ -from django.contrib import admin -from django.db import models -from django.forms import widgets - -# Todo: reversion - -import seminar.models as m - - -class TextAdminInline(admin.TabularInline): - model = m.Text - formfield_overrides = { - models.TextField: {'widget': widgets.TextInput} - } - exclude = ['text_zkraceny_set','text_zkraceny'] - -admin.site.register(m.Text) - -# admin.site.register(m.Pohadka) -admin.site.register(m.Obrazek) diff --git a/treenode/admin.py b/treenode/admin.py index 92c85cd5..8ffe4fc8 100644 --- a/treenode/admin.py +++ b/treenode/admin.py @@ -1,4 +1,6 @@ from django.contrib import admin +from django.db import models +from django.forms import widgets from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin, PolymorphicChildModelFilter @@ -86,3 +88,12 @@ class TextNodeAdmin(PolymorphicChildModelAdmin): show_in_index = True +class TextAdminInline(admin.TabularInline): + model = m.Text + formfield_overrides = { + models.TextField: {'widget': widgets.TextInput} + } + exclude = ['text_zkraceny_set', 'text_zkraceny'] + +admin.site.register(m.Text) +admin.site.register(m.Obrazek) diff --git a/tvorba/admin.py b/tvorba/admin.py index 817c16d3..e6c2c64b 100644 --- a/tvorba/admin.py +++ b/tvorba/admin.py @@ -1,6 +1,5 @@ from django.contrib import admin -from django.db import models -from django.forms import widgets, ModelForm +from django.forms import ModelForm from django.core.exceptions import ValidationError from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin, PolymorphicChildModelFilter @@ -175,3 +174,4 @@ class UlohaAdmin(ProblemAdminMixin,PolymorphicChildModelAdmin): class KonferaAdmin(ProblemAdminMixin,PolymorphicChildModelAdmin): base_model = soustredeni.models.Konfera +# admin.site.register(m.Pohadka)