32 lines
928 B
Python
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"
|