|
|
@ -31,20 +31,20 @@ def prepnout_fotogalerii_do_org_rezimu(modeladmin, request, queryset): |
|
|
|
|
|
|
|
class GalerieInline(admin.TabularInline): |
|
|
|
model = Obrazek |
|
|
|
fields = ['obrazek_velky', 'nazev', 'popis', 'obrazek_maly_tag'] |
|
|
|
fields = ['obrazek_velky', 'nazev', 'popis', 'obrazek_maly_tag', 'poradi'] |
|
|
|
readonly_fields = ['nazev', 'obrazek_maly_tag'] |
|
|
|
formfield_overrides = { |
|
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
|
} |
|
|
|
|
|
|
|
class ObrazekAdmin(admin.ModelAdmin): |
|
|
|
list_display = ('obrazek_velky', 'nazev', 'popis', 'obrazek_maly_tag') |
|
|
|
list_display = ('obrazek_velky', 'nazev', 'popis', 'obrazek_maly_tag', 'poradi') |
|
|
|
|
|
|
|
class GalerieAdmin(admin.ModelAdmin): |
|
|
|
form = autocomplete_light.modelform_factory(Galerie, autocomplete_fields=['titulni_obrazek'], fields=['titulni_obrazek']) |
|
|
|
model = Galerie |
|
|
|
fields = ('zobrazit', 'nazev', 'titulni_obrazek', 'popis', 'galerie_up', 'soustredeni', 'poradi') |
|
|
|
list_display = ('nazev', 'pk', 'poradi', 'datum_zmeny', 'zobrazit', 'soustredeni') |
|
|
|
list_display = ('nazev', 'pk', 'poradi', 'datum_zmeny', 'zobrazit', 'soustredeni', 'poradi') |
|
|
|
inlines = [GalerieInline] |
|
|
|
actions = [zverejnit_fotogalerii, prepnout_fotogalerii_do_org_rezimu] |
|
|
|
save_on_top = True |
|
|
|