Files
fet2020/fet2020/gallery/forms.py
2023-11-20 21:26:14 +00:00

32 lines
928 B
Python

from ckeditor_uploader.widgets import CKEditorUploadingWidget
from django import forms
from .models import Album
class AlbumAdminForm(forms.ModelForm):
class Meta:
model = Album
fields = "__all__"
widgets = {"description": CKEditorUploadingWidget(config_name="default")}
labels = {
"slug": "Permalink",
"event_place": "Event Ort",
"description": "Beschreibung",
}
help_texts = {
"folder_name": "Füge den Ordnername (ohne Pfade) ein.",
"thumbnail": (
"Füge den vollständigen Dateiname (ohne Pfade) ein, wenn dieser als Thumbnail "
"verwendet werden soll."
),
}
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) # to get the self.fields set
self.fields["event_place"].initial = "Gußhausstraße 27-29, 1040 Wien"