Django-admin-action to export items as csv-formatted data.
Project description
Description
Django-admin-csvexport is a django-admin-action, that allows you to export the items of your django-admin changelist as csv-formatted data.
Features
selectable model-fields
related models included
customizable csv-format
view or download csv-data
Installation
Install from pypi.org:
pip install django-admin-csvexport
Add csvexport to your installed apps:
INSTALLED_APPS = [ 'csvexport', ... ]
Add csvexport to the actions of your modeladmin:
from csvexport.actions import csvexport class MyModelAdmin(admin.ModelAdmin): ... actions = [csvexport]
Configuration
The following settings determine the depth of the model references and the value to display for empty fields:
CSV_EXPORT_REFERENCE_DEPTH = 3 CSV_EXPORT_EMPTY_VALUE = ''
Those settings define the csv-format to be used. The default values meet the unix standard csv-format:
CSV_EXPORT_DELIMITER = ',' CSV_EXPORT_ESCAPECHAR = '' CSV_EXPORT_QUOTECHAR = '"' CSV_EXPORT_DOUBLEQUOTE = True CSV_EXPORT_LINETERMINATOR = r'\n'
(Use a raw-string for newline escape sequences.)
Per default the csv-format can be adjusted by a formular when generating the csv-file. Set the following setting to False to not render such form:
CSV_EXPORT_FORMAT_FORM = True
Usage
Just use it as any django-admin-action: Select your items, choose csvexport from the admin-action-bar and go. You will be led to a formular that allows you to render your items as csv-data.
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
Built Distribution
Hashes for django-admin-csvexport-1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 013748f8689f98085afc1dc5726c9da98a9c02fcd75b8bd6f21136d5600cab0e |
|
MD5 | b057d621d902c9fbc3012f800d481b22 |
|
BLAKE2b-256 | 8f376ac5c4496947b9ad671b7542ba4267c8b75657a9b70d937ad4d0341a20c4 |
Hashes for django_admin_csvexport-1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6be73dbc5d88e6b5a6e3deb5ff2089cf1405967d67644cb8720c692f00258d40 |
|
MD5 | 9758cf2e704e0ff8a40f35791495f122 |
|
BLAKE2b-256 | 090f9d601b3305bbd1d3470193d1270ea714d836ea9603b8bbfdfecce857881a |