Skip to content

Commit

Permalink
Update photos.py
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardo-devintage committed Apr 30, 2024
1 parent 6cc585c commit c09aedd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/core/forms/photos.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
from apps.core.models.photos import PhotoAlbum, PhotoObject


class MultipleFileInput(forms.ClearableFileInput):
allow_multiple_selected = True


class PhotoAlbumForm(forms.ModelForm):
photos = forms.ImageField(widget=forms.ClearableFileInput(attrs={"allow_multiple_selected": True}), required=False)
photos = forms.ImageField(widget=MultipleFileInput(), required=False)

class Meta:
model = PhotoAlbum
Expand Down Expand Up @@ -53,7 +57,7 @@ def __init__(self, *args, **kwargs):


class PhotoObjectForm(forms.ModelForm):
photo = forms.ImageField(widget=forms.ClearableFileInput(attrs={"allow_multiple_selected": True}), required=True)
photo = forms.ImageField(widget=MultipleFileInput(), required=True)

class Meta:
model = PhotoObject
Expand Down

0 comments on commit c09aedd

Please sign in to comment.