Easily create XLSX documents with Django
Project description
This is a wrapper for openpyxl which makes creating XLSX documents with the purpose of exporting data less boring:
from xlsxdocument import XLSXDocument def xlsx_export(request): some_data = Bla.objects.all() xlsx = XLSXDocument() xlsx.table_from_queryset(Bla.objects.all()) return xlsx.to_response('bla.xlsx')
Adding in additional cells at the end is also possible:
xlsx = XLSXDocument() xlsx.table_from_queryset( Bla.objects.all(), additional=[( 'Full URL', lambda instance: 'http://example.com%s' % ( instance.get_absolute_url(), ), )], )
You can also easily add the facility to export rows to Django’s administration interface:
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from xlsxdocument import export_selected from app import models class AttendanceAdmin(admin.ModelAdmin): list_filter = ('event',) actions = (export_selected,) admin.site.register(models.Event) admin.site.register(models.Attendance, AttendanceAdmin)
Project details
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
xlsxdocument-1.1.0.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file xlsxdocument-1.1.0.tar.gz
.
File metadata
- Download URL: xlsxdocument-1.1.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 120505dac06319bac989262507f09ba7615d3878c2cdcd4ce560bbda019a8ebb |
|
MD5 | 5521e20267c152afc627996c329d7375 |
|
BLAKE2b-256 | ddaac3c17f26ea5c1bc4f79d92841df3dba2a2dca33a42a199aadbf0a03a264c |
File details
Details for the file xlsxdocument-1.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: xlsxdocument-1.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28c1a841ac25c70e4f9387ebef1ddd19638aca59dc6055c9dbb01068f790e513 |
|
MD5 | 8c49132ff24b40bfc9a8718df7cb6d69 |
|
BLAKE2b-256 | fb6ec45cfb548ffdf4183cfeb8e6d41c46510cccb19c9a3d03003cec2aa15678 |