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
Supported Django-versions
Django-1.11
Django-2.0
Django-2.1
Django-2.2
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'
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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ea327a8f9519722f4b8f95a6606b2ad85c3663a895892cb6e2bc8f94fefb4b5 |
|
MD5 | b9c72f47298378599195849f46ad9002 |
|
BLAKE2b-256 | f82df49cb8c48a2da84f409103a31989a63ca967a950d739b0b11e8ffff777fc |
Hashes for django_admin_csvexport-1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 589f7c70d6a1b4ada1c5777ab4b8ebeac9706027c6c4dc6462aeb5cd40ecf5ae |
|
MD5 | d07734c993cd78b2fb771d186b9308fc |
|
BLAKE2b-256 | d0e374412926f8a1919ccfe695c3f36a451489f7ae0a4fdf50242611828beb61 |