From 5268308eeb2a8eb5235a46139013fec1afafeb8b Mon Sep 17 00:00:00 2001 From: Amanda Liu Date: Wed, 9 Sep 2026 12:21:24 -0400 Subject: [PATCH] Multiple input file upload --- materials/forms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/materials/forms.py b/materials/forms.py index 2f43dc1..9290d39 100644 --- a/materials/forms.py +++ b/materials/forms.py @@ -165,6 +165,8 @@ class AddSystemForm(forms.Form): help_text="Enter n value for the dimensionality of this system if it applies", ) +class MultipleFileInput(forms.ClearableFileInput): + allow_multiple_selected = True class AddPropertyForm(forms.Form): name = forms.CharField( @@ -688,8 +690,8 @@ class AddDataForm(forms.Form): # Uploads uploaded_files = forms.FileField( required=False, - widget=forms.ClearableFileInput(attrs={"allow_multiple_selected": True}), - # widget=forms.ClearableFileInput(attrs={'allow_multiple_selected': True}), + widget=MultipleFileInput(), + #widget=forms.ClearableFileInput(attrs={'allow_multiple_selected': True}), help_text="" "Upload files containing anything that is relevant to the current " "data (input files to a calculation, image of the sample, ...). "