Dead simple drop-in multi file upload field for django forms using HTML5's multiple attribute.
Project description
Dead simple drop-in multi file upload field for django forms using HTML5’s multiple attribute.
Installation
Install the package using pip (or easy_install if you really have to)
$ pip install django-multiupload
or directly from this repository the get the development version (if you’re feeling adventurous)
$ pip install -e git+https://github.com/Chive/django-multiupload.git#egg=multiupload
Usage
Add the form field to your form and make sure to save the uploaded files in the form’s save method
from multiupload.fields import MultiFileField class MyUploadForm(forms.Form): attachments = MultiFileField(max_num=3, min_num=1, max_file_size=1024*1024*5) ... def save(self, commit=True): super(MyUploadForm, self).save(commit=commit) for each in self.cleaned_data['attachments']: att = Attachment(parent=self.instance, file=each) att.save() return self.instance
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-multiupload-0.2.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for django_multiupload-0.2-py27-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19804b3b554b59a65eefbd2c8c3b72a1742808aa3addbc29b9219511ae520d55 |
|
MD5 | 355e3642d48b8f6cafd55ee19e5295da |
|
BLAKE2b-256 | 5be4dc1c2d19374907d22f65f23785e069855274b4b8e99ceb6e7c280397261f |