-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathforms.py
38 lines (32 loc) · 1.14 KB
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from django import forms
from django.conf import settings
class NewUploadForm(forms.Form):
file_field_names = ["file_upload"]
file_upload = forms.FileField(
widget=forms.FileInput(
attrs={
"accept": ",".join(
settings.ALLOWED_JSON_CONTENT_TYPES
+ settings.ALLOWED_JSON_EXTENSIONS
+ settings.ALLOWED_SPREADSHEET_CONTENT_TYPES
+ settings.ALLOWED_SPREADSHEET_EXTENSIONS
)
}
),
label="",
)
sample_mode = forms.BooleanField(
label="Process using Sample mode (see information above)", required=False
)
class NewTextForm(forms.Form):
file_field_names = []
paste = forms.CharField(label="Paste (JSON only)", widget=forms.Textarea)
sample_mode = forms.BooleanField(
label="Process using Sample mode (see information above)", required=False
)
class NewURLForm(forms.Form):
file_field_names = []
url = forms.URLField(label="URL")
sample_mode = forms.BooleanField(
label="Process using Sample mode (see information above)", required=False
)