Add upload page

This commit is contained in:
Alexandre Iooss 2021-10-15 10:55:07 +02:00
parent 583a1ffce8
commit 727387566d
5 changed files with 185 additions and 33 deletions

View file

@ -0,0 +1,22 @@
from django import forms
from django.utils.translation import gettext_lazy as _
from photologue.models import Gallery
class UploadForm(forms.Form):
file_field = forms.FileField(
label="",
widget=forms.ClearableFileInput(attrs={'multiple': True}),
)
gallery = forms.ModelChoiceField(
Gallery.objects.all(),
label=_('Gallery'),
required=False,
help_text=_('Select a gallery to add these images to. Leave this empty to '
'create a new gallery from the supplied title.')
)
new_gallery_title = forms.CharField(
label=_('New gallery title'),
max_length=250,
required=False,
)