summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-29 11:35:30 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-29 11:35:30 +0000
commitbc409861d21a690a1ccc0b9b42f737eab17f0142 (patch)
tree072b9e4dde5dfffafd8d16d660ebdc1a201c89f5
parent6bc6aee2fb5488e36680ec15259500d094fd8787 (diff)
automatic import of python-django-multiupload2
-rw-r--r--.gitignore1
-rw-r--r--python-django-multiupload2.spec297
-rw-r--r--sources1
3 files changed, 299 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..d49ac90 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/django-multiupload2-0.5.3.tar.gz
diff --git a/python-django-multiupload2.spec b/python-django-multiupload2.spec
new file mode 100644
index 0000000..0454e92
--- /dev/null
+++ b/python-django-multiupload2.spec
@@ -0,0 +1,297 @@
+%global _empty_manifest_terminate_build 0
+Name: python-django-multiupload2
+Version: 0.5.3
+Release: 1
+Summary: Dead simple drop-in multi file upload field for django forms using HTML5's multiple attribute.
+License: LICENSE.txt
+URL: https://github.com/Chive/django-multiupload
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/68/ae/8bd9fb5e202d96818de832c6bba207345d21c94bed68cd1e15a52f2ec65e/django-multiupload2-0.5.3.tar.gz
+BuildArch: noarch
+
+
+%description
+# Django Multiupload
+
+[![Build Status](https://travis-ci.org/Chive/django-multiupload.svg?branch=master)](https://travis-ci.org/Chive/django-multiupload)
+
+
+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)
+
+```bash
+$ pip install django-multiupload
+```
+
+* Or directly from this repository to get the development version (if you're feeling adventurous)
+
+```bash
+$ 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.
+
+For more detailed examples visit the [examples section](https://github.com/Chive/django-multiupload/tree/master/examples).
+
+
+```python
+# forms.py
+from django import forms
+from multiupload.fields import MultiFileField, MultiMediaField, MultiImageField
+
+class UploadForm(forms.Form):
+ attachments = MultiFileField(min_num=1, max_num=3, max_file_size=1024*1024*5)
+
+ # If you need to upload media files, you can use this:
+ attachments = MultiMediaField(
+ min_num=1,
+ max_num=3,
+ max_file_size=1024*1024*5,
+ media_type='video' # 'audio', 'video' or 'image'
+ )
+
+ # For images (requires Pillow for validation):
+ attachments = MultiImageField(min_num=1, max_num=3, max_file_size=1024*1024*5)
+```
+
+The latter two options just add fancy attributes to HTML's `<input>`, restricting the scope to corresponding filetypes.
+
+```python
+# models.py
+from django.db import models
+
+class Attachment(models.Model):
+ file = models.FileField(upload_to='attachments')
+
+```
+
+```python
+# views.py
+from django.views.generic.edit import FormView
+from .forms import UploadForm
+from .models import Attachment
+
+class UploadView(FormView):
+ template_name = 'form.html'
+ form_class = UploadForm
+ success_url = '/done/'
+
+ def form_valid(self, form):
+ for each in form.cleaned_data['attachments']:
+ Attachment.objects.create(file=each)
+ return super(UploadView, self).form_valid(form)
+
+```
+
+%package -n python3-django-multiupload2
+Summary: Dead simple drop-in multi file upload field for django forms using HTML5's multiple attribute.
+Provides: python-django-multiupload2
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-django-multiupload2
+# Django Multiupload
+
+[![Build Status](https://travis-ci.org/Chive/django-multiupload.svg?branch=master)](https://travis-ci.org/Chive/django-multiupload)
+
+
+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)
+
+```bash
+$ pip install django-multiupload
+```
+
+* Or directly from this repository to get the development version (if you're feeling adventurous)
+
+```bash
+$ 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.
+
+For more detailed examples visit the [examples section](https://github.com/Chive/django-multiupload/tree/master/examples).
+
+
+```python
+# forms.py
+from django import forms
+from multiupload.fields import MultiFileField, MultiMediaField, MultiImageField
+
+class UploadForm(forms.Form):
+ attachments = MultiFileField(min_num=1, max_num=3, max_file_size=1024*1024*5)
+
+ # If you need to upload media files, you can use this:
+ attachments = MultiMediaField(
+ min_num=1,
+ max_num=3,
+ max_file_size=1024*1024*5,
+ media_type='video' # 'audio', 'video' or 'image'
+ )
+
+ # For images (requires Pillow for validation):
+ attachments = MultiImageField(min_num=1, max_num=3, max_file_size=1024*1024*5)
+```
+
+The latter two options just add fancy attributes to HTML's `<input>`, restricting the scope to corresponding filetypes.
+
+```python
+# models.py
+from django.db import models
+
+class Attachment(models.Model):
+ file = models.FileField(upload_to='attachments')
+
+```
+
+```python
+# views.py
+from django.views.generic.edit import FormView
+from .forms import UploadForm
+from .models import Attachment
+
+class UploadView(FormView):
+ template_name = 'form.html'
+ form_class = UploadForm
+ success_url = '/done/'
+
+ def form_valid(self, form):
+ for each in form.cleaned_data['attachments']:
+ Attachment.objects.create(file=each)
+ return super(UploadView, self).form_valid(form)
+
+```
+
+%package help
+Summary: Development documents and examples for django-multiupload2
+Provides: python3-django-multiupload2-doc
+%description help
+# Django Multiupload
+
+[![Build Status](https://travis-ci.org/Chive/django-multiupload.svg?branch=master)](https://travis-ci.org/Chive/django-multiupload)
+
+
+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)
+
+```bash
+$ pip install django-multiupload
+```
+
+* Or directly from this repository to get the development version (if you're feeling adventurous)
+
+```bash
+$ 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.
+
+For more detailed examples visit the [examples section](https://github.com/Chive/django-multiupload/tree/master/examples).
+
+
+```python
+# forms.py
+from django import forms
+from multiupload.fields import MultiFileField, MultiMediaField, MultiImageField
+
+class UploadForm(forms.Form):
+ attachments = MultiFileField(min_num=1, max_num=3, max_file_size=1024*1024*5)
+
+ # If you need to upload media files, you can use this:
+ attachments = MultiMediaField(
+ min_num=1,
+ max_num=3,
+ max_file_size=1024*1024*5,
+ media_type='video' # 'audio', 'video' or 'image'
+ )
+
+ # For images (requires Pillow for validation):
+ attachments = MultiImageField(min_num=1, max_num=3, max_file_size=1024*1024*5)
+```
+
+The latter two options just add fancy attributes to HTML's `<input>`, restricting the scope to corresponding filetypes.
+
+```python
+# models.py
+from django.db import models
+
+class Attachment(models.Model):
+ file = models.FileField(upload_to='attachments')
+
+```
+
+```python
+# views.py
+from django.views.generic.edit import FormView
+from .forms import UploadForm
+from .models import Attachment
+
+class UploadView(FormView):
+ template_name = 'form.html'
+ form_class = UploadForm
+ success_url = '/done/'
+
+ def form_valid(self, form):
+ for each in form.cleaned_data['attachments']:
+ Attachment.objects.create(file=each)
+ return super(UploadView, self).form_valid(form)
+
+```
+
+%prep
+%autosetup -n django-multiupload2-0.5.3
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-django-multiupload2 -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 29 2023 Python_Bot <Python_Bot@openeuler.org> - 0.5.3-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..ec20a29
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+f8613c277bfa1299467a581f19861946 django-multiupload2-0.5.3.tar.gz