{ "info": { "author": "S\u00f6ren Berger", "author_email": "soeren.berger@u1337.de", "bugtrack_url": null, "classifiers": [ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)" ], "description": "# django-export-download\n\n`django-export-download` allows you to use your ListView to download it in different file formats\nlike CSV or XLS by just adding the Mixin.\n\nIt provides a MultipleObject/ListView Mixin for Django. By passing the `download` GET parameter you can\ndownload the file. \nYou can use this view to download the object list in different file fomats like CSV, XLS and more. \nYou just have to provide a `Resource` class from `django-import-export`.\n\nI addition it work very good in you `django-tables2`/`django-filter` environment.\n\nFinally the package ships with a templatetag to include some download buttons in your ListView template.\n\n\n# Requirements\nThe package is tested with following versions, but it also should \nwork with newer or older versions\n\n* Django >= 1.11\n* django-import-export >= 1.0.0\n* Python >= 3.5\n\n# Quickstart\n\n```python\nviews.py:\n\nfrom import_export import resources\nfrom export_download.views import ResourceDownloadMixin\nfrom django.views.generic import ListView\n\n\nclass MovieBudgetResource(resources.ModelResource):\n class Meta:\n model = Movie\n fields = ['title', 'budget']\n\n\nclass MovieListView(ResourceDownloadMixin, ListView):\n model = Movie\n resource_class = MovieBudget\n \nurls.py:\n\nurlpatterns = [\n path('movie/', MovieListView.as_view(), name='movie-list'),\n]\n```\n\nBy visiting http://localhost:8000/movie/?download you can download a CSV (which is the default) file with the movies \nand their budget.\n\n```http://localhost:8000/movie/?download&resource_format=xls will download a Excel file.```\n# Dokumentation\n\n## Class Options\nHere is a more complex example that includes several `Resources` and different file formats.\nIt also is a example how to use `django-export-download` with `django-filter` and `django-tables2`.\n```python\n\nimport django_tables2 as table\nfrom import_export import resources\nfrom export_download.views import ResourceDownloadMixin\nfrom django.views.generic import ListView\n \n\nclass MovieResource(resources.ModelResource):\n class Meta:\n model = Movie\n fields = ['title', 'budget', 'tatus', 'votes', 'release_date']\n \nclass OnlyMovieResource(resources.ModelResource):\n class Meta:\n model = Movie\n fields = ['title']\n\nclass MovieBudgetResource(resources.ModelResource):\n class Meta:\n model = Movie\n fields = ['title', 'budget']\n\n\nclass MovieListView(ResourceDownloadMixin, ListView, table.SingleTableMixin):\n model = Movie\n table_class = MovieTable\n filter_class = MovieFilter\n\n resource_class = [\n MovieResource,\n OnlyMovieResource,\n MovieBudgetResource\n ]\n resource_formats = ['csv', 'tsv', 'xls']\n```\nThis implementation support 3 download formats with 3 different `Resources`. Following URLs are giving \nyou the files:\n\n```\nhttp://localhost:8000/movie/?download&resource_class=0&resource_format=xls\nhttp://localhost:8000/movie/?download&resource_class=0&resource_format=csv\nhttp://localhost:8000/movie/?download&resource_class=0&resource_format=tsv\nhttp://localhost:8000/movie/?download&resource_class=1&resource_format=xls\nhttp://localhost:8000/movie/?download&resource_class=1&resource_format=csv\nhttp://localhost:8000/movie/?download&resource_class=1&resource_format=tsv\nhttp://localhost:8000/movie/?download&resource_class=2&resource_format=xls\nhttp://localhost:8000/movie/?download&resource_class=2&resource_format=csv\nhttp://localhost:8000/movie/?download&resource_class=2&resource_format=tsv\n```\n\nNote that `resource_class` defines the position of the `Resource` implementation in the list of `resource_class`\n\nIn this example there also is a `filter_class`. `django-export-download` automatically applies the filter\nto the queryset. It is not required, but works really well. Have a look at https://github.com/carltongibson/django-filter\nfor more information.\n\n## Templatetags\n`django-export-download` ships with a templatetag to render all links above.\n\nYou now can use the templatetag in you ListView\n```html\n{% load export_download %}\n\n{% resource_download_menu %}\n```\n# Contribute\nFork and send a PR", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/soerenbe/django-export-download/", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/soerenbe/django-export-download", "keywords": "django,nagios,icinga", "license": "GPL-3", "maintainer": "", "maintainer_email": "", "name": "django-export-download", "package_url": "https://pypi.org/project/django-export-download/", "platform": "", "project_url": "https://pypi.org/project/django-export-download/", "project_urls": { "Download": "https://github.com/soerenbe/django-export-download/", "Homepage": "https://github.com/soerenbe/django-export-download" }, "release_url": "https://pypi.org/project/django-export-download/0.2.3/", "requires_dist": null, "requires_python": "", "summary": "A Django library that adds a ListView Mixin for downloading a list in different file formats", "version": "0.2.3" }, "last_serial": 4216268, "releases": { "0.1.4": [ { "comment_text": "", "digests": { "md5": "e2a4748218702be90daf1a62131a9ede", "sha256": "039d85ca602c4ce3b52b6ce2623c288d09bd300bc6d5c1cde914fa0dd16c9f30" }, "downloads": -1, "filename": "django_export_download-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "e2a4748218702be90daf1a62131a9ede", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5969, "upload_time": "2018-08-17T21:40:04", "url": "https://files.pythonhosted.org/packages/57/ab/3a3fbf9a507a6176d50110fcb3427c9a924b9c56a663ccff893ff18cfbec/django_export_download-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e0cd4429b4c57987da6d565ea6e3187", "sha256": "dcab01dd929ec0025d536dae2b723a009d294c9b0d37acb671f37dbf6fefc470" }, "downloads": -1, "filename": "django-export-download-0.1.4.tar.gz", "has_sig": false, "md5_digest": "1e0cd4429b4c57987da6d565ea6e3187", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5204, "upload_time": "2018-08-17T21:40:05", "url": "https://files.pythonhosted.org/packages/72/b0/ed6ffad36cfaa8aa9d20d4a6e1d88522ccf9a29b80e1bb3e2d34d8310352/django-export-download-0.1.4.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "ae246e5d3abeff126d5d9ddca5d6b425", "sha256": "f0b6122472be227a1f484867a86b89be562ee53192309eab91135af3ee99cddc" }, "downloads": -1, "filename": "django_export_download-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ae246e5d3abeff126d5d9ddca5d6b425", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5705, "upload_time": "2018-08-23T20:47:39", "url": "https://files.pythonhosted.org/packages/15/d0/fd85accef27badb44d3531e41dd7a1c65ef6ce9775cba7abbedbfc36eb6d/django_export_download-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cbbef89f05e9cea4526e860897b6bc91", "sha256": "37ee07f33a84f36a8ebfdaa96893ec6dfb464e2d6f50664f6dc1ace5f2541ac9" }, "downloads": -1, "filename": "django-export-download-0.2.0.tar.gz", "has_sig": false, "md5_digest": "cbbef89f05e9cea4526e860897b6bc91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4984, "upload_time": "2018-08-23T20:47:40", "url": "https://files.pythonhosted.org/packages/47/f2/6c35a61452f2946e9656327ba136ca4db59815b7c90fbaeb1d3f1309f7a0/django-export-download-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "83460051bafb0a1c6f41b43c74838d00", "sha256": "c4d20196cc9fa63d8112988f25c9590fbe146fca3164af78eca40a09663a22af" }, "downloads": -1, "filename": "django_export_download-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "83460051bafb0a1c6f41b43c74838d00", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5696, "upload_time": "2018-08-23T20:57:22", "url": "https://files.pythonhosted.org/packages/b9/19/359d91c3180424e53c5b73931189f3aa2e02eb0e8845a55bfe3395366d7a/django_export_download-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3cff947bba596363a823379d6bfbb50c", "sha256": "40084a4152a270b7014989b720db9521db878e9b2f6560a9f8aa3e33cdac5aaa" }, "downloads": -1, "filename": "django-export-download-0.2.1.tar.gz", "has_sig": false, "md5_digest": "3cff947bba596363a823379d6bfbb50c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4979, "upload_time": "2018-08-23T20:57:23", "url": "https://files.pythonhosted.org/packages/9a/d7/d2ce4f224c7eed6f2259e25546c804a1559e301a2b1229727ab230d4e1c6/django-export-download-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "394373cd43a91c533197db4007e849bf", "sha256": "f71ef9efd82f1a45d0a26aae519354c8fd5bd19cb8e26a3cb863ce8ddc640465" }, "downloads": -1, "filename": "django-export-download-0.2.2.tar.gz", "has_sig": false, "md5_digest": "394373cd43a91c533197db4007e849bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4674, "upload_time": "2018-08-27T18:15:59", "url": "https://files.pythonhosted.org/packages/06/53/51dca1c6c8f0acc3f83d10cc433fde1527632115d19569afd42ddbce7f18/django-export-download-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "56da5d0190a193e6eeea1926a91a38b0", "sha256": "decc0c7e180c152e1739bf15ae4f13c5422d3cd5ed9c014f0536b39a94f99990" }, "downloads": -1, "filename": "django-export-download-0.2.3.tar.gz", "has_sig": false, "md5_digest": "56da5d0190a193e6eeea1926a91a38b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4965, "upload_time": "2018-08-28T19:20:30", "url": "https://files.pythonhosted.org/packages/11/45/388a99b60d31ba01245bcd17ec99e464f1cb799933cab42e77116b1b3c6c/django-export-download-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "56da5d0190a193e6eeea1926a91a38b0", "sha256": "decc0c7e180c152e1739bf15ae4f13c5422d3cd5ed9c014f0536b39a94f99990" }, "downloads": -1, "filename": "django-export-download-0.2.3.tar.gz", "has_sig": false, "md5_digest": "56da5d0190a193e6eeea1926a91a38b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4965, "upload_time": "2018-08-28T19:20:30", "url": "https://files.pythonhosted.org/packages/11/45/388a99b60d31ba01245bcd17ec99e464f1cb799933cab42e77116b1b3c6c/django-export-download-0.2.3.tar.gz" } ] }