Rozstřílení seminářové aplikace #60
3 changed files with 13 additions and 22 deletions
|
@ -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)
|
|
|
@ -1,4 +1,6 @@
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from django.db import models
|
||||||
|
from django.forms import widgets
|
||||||
|
|
||||||
from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin, PolymorphicChildModelFilter
|
from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin, PolymorphicChildModelFilter
|
||||||
|
|
||||||
|
@ -86,3 +88,12 @@ class TextNodeAdmin(PolymorphicChildModelAdmin):
|
||||||
show_in_index = True
|
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)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.db import models
|
from django.forms import ModelForm
|
||||||
from django.forms import widgets, ModelForm
|
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
|
|
||||||
from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin, PolymorphicChildModelFilter
|
from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin, PolymorphicChildModelFilter
|
||||||
|
@ -175,3 +174,4 @@ class UlohaAdmin(ProblemAdminMixin,PolymorphicChildModelAdmin):
|
||||||
class KonferaAdmin(ProblemAdminMixin,PolymorphicChildModelAdmin):
|
class KonferaAdmin(ProblemAdminMixin,PolymorphicChildModelAdmin):
|
||||||
base_model = soustredeni.models.Konfera
|
base_model = soustredeni.models.Konfera
|
||||||
|
|
||||||
|
# admin.site.register(m.Pohadka)
|
||||||
|
|
Loading…
Reference in a new issue