{ "info": { "author": "Thibault Jouannic", "author_email": "thibault@miximum.fr", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "Django ZipView\n==============\n\n[![Build Status](https://travis-ci.org/thibault/django-zipview.svg?branch=master)](https://travis-ci.org/thibault/django-zipview)\n\nA base view to zip and stream several files.\n\nInstallation\n------------\n\n pip install django-zipview\n\nUsage and examples\n------------------\n\nTo create a zip download view:\n\n * Extend BaseZipView\n * implement `get_files`\n * That's it\n\nThe `get_files` method must return a list of Django's File objects.\n\nExample:\n\n```python\nfrom zipview.views import BaseZipView\n\nfrom emails import Email\n\n\nclass AttachmentsArchiveView(BaseZipView):\n \"\"\"Download at once all comments for a review.\"\"\"\n\n def get_files(self):\n emails = Email.objects \\\n .filter(user=self.request.user) \\\n .exclude(attachment__isnull=True)\n\n return [email.attachment.file for email in emails if email.attachment.name]\n```\n\nView configuration\n------------------\n\nBy default, the downloaded file is named `download.zip` you can set a custom name\nby setting the `zipfile_name` parameter.\n\n```python\n\nclass ZipView(BaseZipView):\n zipfile_name = 'toto.zip'\n```\n\nIn case you need to dynamically set the filename, you can override the\n`get_archive_name` method. It takes the request as a parameter.\n\n```python\n\ndef get_archive_name(self, request):\n import datetime\n today = datetime.date.today()\n return 'archive_{:%Y%m%d}.zip'.format(today)\n```\n\nCompatibility\n-------------\n\nCurrent supported django versions are 1.8 & 1.9.\n\nTesting\n-------\n\nDjango ZipView uses [tox, the testing automation\ntool](https://tox.readthedocs.org/en/latest/), to run tests.\n\nTo launch tests:\n\n pip install -r requiments/test.txt\n tox\n\n\nAuthor\n------\n\nCrafted with love by [Thibault Jouannic](http://www.miximum.fr). You can\ncontact him for [Python / Django freelancing\ngigs](http://www.miximum.fr/a-propos/).", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/thibault/django-zipview/", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "django-zipview", "package_url": "https://pypi.org/project/django-zipview/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-zipview/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/thibault/django-zipview/" }, "release_url": "https://pypi.org/project/django-zipview/1.2.0/", "requires_dist": null, "requires_python": null, "summary": "A simple Django base view to zip and stream several files.", "version": "1.2.0" }, "last_serial": 1963300, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "2fb44d251d1e58e3750919c6e1aae0b5", "sha256": "0121dde90b339e181425a684c2fab38138fb271b728e01415a4b0f97f9a06d6f" }, "downloads": -1, "filename": "django-zipview-1.0.0.tar.gz", "has_sig": false, "md5_digest": "2fb44d251d1e58e3750919c6e1aae0b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3881, "upload_time": "2014-10-30T16:22:04", "url": "https://files.pythonhosted.org/packages/4e/8d/abc579484c39a847a9d8ef40fbab406781827bba6facf7adcfbfd3894817/django-zipview-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "a79725e8f6a0da95a80e766c2cce1599", "sha256": "4a3317b9adf5320984173cbec2e41e1c45e7917a40bdd2cb1b31cd45cee020b5" }, "downloads": -1, "filename": "django-zipview-1.1.0.tar.gz", "has_sig": false, "md5_digest": "a79725e8f6a0da95a80e766c2cce1599", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4125, "upload_time": "2016-02-18T13:39:09", "url": "https://files.pythonhosted.org/packages/be/0c/68be3a11ba6cf4eef613f008243dc50c386cd69ddb06039914343a46bae5/django-zipview-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "a01e1d172b7979f4cddca59bbd9c4a97", "sha256": "bf7bc775289fee7458d8d7389c593318cbef15346632c234b9debb295a3ae0f2" }, "downloads": -1, "filename": "django-zipview-1.1.1.tar.gz", "has_sig": false, "md5_digest": "a01e1d172b7979f4cddca59bbd9c4a97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4121, "upload_time": "2016-02-18T13:45:09", "url": "https://files.pythonhosted.org/packages/49/dc/141bd0d3d279f1b518cfcdc6be782d1a8d6e15abf8c2b744ccd63a2c57b7/django-zipview-1.1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "1683f3f465574c4deb575802a0e7f67e", "sha256": "61455d211f2d84440fd718e218f65dd28b02ebb2c438af12639d56cb41c0fdc4" }, "downloads": -1, "filename": "django-zipview-1.2.0.tar.gz", "has_sig": false, "md5_digest": "1683f3f465574c4deb575802a0e7f67e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4290, "upload_time": "2016-02-18T14:26:43", "url": "https://files.pythonhosted.org/packages/21/ae/a59be3231f929f56563ad1a7aab7b391b211ed5cea86720f2ee7ae8e5014/django-zipview-1.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1683f3f465574c4deb575802a0e7f67e", "sha256": "61455d211f2d84440fd718e218f65dd28b02ebb2c438af12639d56cb41c0fdc4" }, "downloads": -1, "filename": "django-zipview-1.2.0.tar.gz", "has_sig": false, "md5_digest": "1683f3f465574c4deb575802a0e7f67e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4290, "upload_time": "2016-02-18T14:26:43", "url": "https://files.pythonhosted.org/packages/21/ae/a59be3231f929f56563ad1a7aab7b391b211ed5cea86720f2ee7ae8e5014/django-zipview-1.2.0.tar.gz" } ] }