##// END OF EJS Templates
Fixed multiple file upload in django 1.11
neko259 -
r1900:519e9955 default
parent child Browse files
Show More
@@ -19,13 +19,6 b' class MultipleFileInput(forms.FileInput)'
19 else:
19 else:
20 return files.getlist(name)
20 return files.getlist(name)
21
21
22 def render(self, name, value, attrs=None):
23 if not attrs:
24 attrs = dict()
25 attrs['multiple'] = ''
26
27 return super().render(name, None, attrs=attrs)
28
29
22
30 class MultipleFileField(forms.FileField):
23 class MultipleFileField(forms.FileField):
31 """
24 """
@@ -48,7 +41,10 b' class UrlFileWidget(forms.MultiWidget):'
48 """
41 """
49 def __init__(self, *args, **kwargs):
42 def __init__(self, *args, **kwargs):
50 widgets = (
43 widgets = (
51 MultipleFileInput(attrs={'accept': 'file/*'}),
44 MultipleFileInput(attrs={
45 'accept': 'file/*',
46 'multiple': ''
47 }),
52 forms.Textarea(attrs={
48 forms.Textarea(attrs={
53 ATTRIBUTE_PLACEHOLDER: URL_PLACEHOLDER,
49 ATTRIBUTE_PLACEHOLDER: URL_PLACEHOLDER,
54 ATTRIBUTE_ROWS: URL_ROWS,
50 ATTRIBUTE_ROWS: URL_ROWS,
General Comments 0
You need to be logged in to leave comments. Login now