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