django-spreadsheetresponsemixin 0.1.7
pip install django-spreadsheetresponsemixin==0.1.7
Newer version available (0.1.10)
Released:
An mixin for views with a queryset that provides a CSV/Excel export.
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: GNU General Public License v3 (GPLv3) (GNU GENERAL PUBLIC LICENSE)
- Author: Sarah Bird
Classifiers
- Development Status
- Environment
- Framework
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Project description
django-spreadsheetresponsemixin
View mixin for django, that generates a csv or excel sheet.
Usage
Add to your django view as a mixin:
class ExcelExportView(SpreadsheetResponseMixin, ListView): def get(self, request): self.queryset = self.get_queryset() return self.render_excel_response() class CsvExportView(SpreadsheetResponseMixin, ListView): def get(self, request): self.queryset = self.get_queryset() return self.render_csv_response()
Note you must specify a Queryset, ValuesQueryset or ValuesListQueryset on the class or pass it in when you call the render method.
You can also specify the fields and the headers as tuples if you want to refine the results and / or provide custom headers for your columns
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: GNU General Public License v3 (GPLv3) (GNU GENERAL PUBLIC LICENSE)
- Author: Sarah Bird
Classifiers
- Development Status
- Environment
- Framework
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-spreadsheetresponsemixin-0.1.7.tar.gz
.
File metadata
- Download URL: django-spreadsheetresponsemixin-0.1.7.tar.gz
- Upload date:
- Size: 38.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
506e25eeba012ddeaca2c06056dbcb546e93b589a0059b64105d17d4f3aec961
|
|
MD5 |
e3a11deba708191c2b829486204502df
|
|
BLAKE2b-256 |
c87f5e6aacb5e99c8e8b0766a9c8dc88f3130e884ea81c471c902fa9274d0c70
|