16 lines
547 B
Python
16 lines
547 B
Python
from django import forms
|
|
from multiupload.fields import MultiFileField
|
|
from retriever.models import Keywords
|
|
|
|
|
|
class SpaceSeparatedField(forms.CharField):
|
|
def to_python(self, value):
|
|
if not value:
|
|
return []
|
|
return value.split(' ')
|
|
|
|
|
|
class UploadForm(forms.Form):
|
|
attachments = MultiFileField(min_num=1, max_num=10, max_file_size=1024 * 1024 * 64,
|
|
attrs={'class': 'file-input is-primary', 'accept': '.docx, .doc, .dot, .pptx, .ppt, .pdf, .xls, .xlsx, .txt', 'id': 'file-input'})
|