This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
Django ZipView
==============

[![Build Status](https://travis-ci.org/thibault/django-zipview.svg?branch=master)](https://travis-ci.org/thibault/django-zipview)

A base view to zip and stream several files.

Installation
------------

pip install django-zipview

Usage and examples
------------------

To create a zip download view:

* Extend BaseZipView
* implement `get_files`
* That's it

The `get_files` method must return a list of Django's File objects.

Example:

```python
from zipview.views import BaseZipView

from emails import Email


class AttachmentsArchiveView(BaseZipView):
"""Download at once all comments for a review."""

def get_files(self):
emails = Email.objects \
.filter(user=self.request.user) \
.exclude(attachment__isnull=True)

return [email.attachment.file for email in emails if email.attachment.name]
```

View configuration
------------------

By default, the downloaded file is named `download.zip` you can set a custom name
by setting the `zipfile_name` parameter.

```python

class ZipView(BaseZipView):
zipfile_name = 'toto.zip'
```

In case you need to dynamically set the filename, you can override the
`get_archive_name` method. It takes the request as a parameter.

```python

def get_archive_name(self, request):
import datetime
today = datetime.date.today()
return 'archive_{:%Y%m%d}.zip'.format(today)
```

Compatibility
-------------

Current supported django versions are 1.8 & 1.9.

Testing
-------

Django ZipView uses [tox, the testing automation
tool](https://tox.readthedocs.org/en/latest/) to run tests.

To launch tests:

pip install -r requiments/test.txt
tox


Author
------

Crafted with love by [Thibault Jouannic](http://www.miximum.fr). You can
contact him for [Python / Django freelancing
gigs](http://www.miximum.fr/a-propos/)
Release History

Release History

1.2.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-zipview-1.2.0.tar.gz (4.3 kB) Copy SHA256 Checksum SHA256 Source Feb 18, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting