Export action for django admin
Project description
Django Admin Export Action
Export action for Django's Admin
Quickstart
Install Django Admin Export Action::
pip install django-admin-export-action
Include it in INSTALLED_APPS::
INSTALLED_APPS = [
# ...
'admin_export_action',
]
Add to urlpatterns
in urls.py
:
path('export_action/', include("admin_export_action.urls", namespace="admin_export_action")),
Configuration
By default the export action will be added sitewide, which means for every app and every admin registered model.
You can disable this behaviour and decide to add manually the export action only for the models you desired:
# settings.py
ADMIN_EXPORT_ACTION = {
'ENABLE_SITEWIDE': False
}
# model admin
from admin_export_action.admin import export_selected_objects
class MyModelAdmin(models.ModelAdmin):
# ...
actions = [export_selected_objects, ]
Usage
Go to an admin page where the export action is enabled, select objects, run the action.
In the next page:
- select the fields you want to export
- select the output format
- select whether to get raw choices values or not
- select whether to include table header (field verbose name) or not
- click the "Export" button
Features
- Generic or ready to use action to enable export data from Admin.
- Automatic traversal of model relations.
- Selection of fields to export.
- Can export to XSLx, CSV, JSON and HTML.
Running Tests
Does the code actually work?
cd testapp/app
source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements.txt
(myenv) $ python manage.py test
Security
This project assumes staff users are trusted. There may be ways for users to manipulate this project to get more data access than they should have.
Credits
This project is developed by Otto srl, and originally foked from fgmacedo/django-export-action
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-export-action-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b525492137d981139bb8cdfc257022ee4825aae57922415a930ead3be41a6ac7 |
|
MD5 | 19261d1008a23e7e29ea50ee1250836b |
|
BLAKE2b-256 | b0dcd5c7bb71bad1e37fb02ed8e281e0b689e3a9923589315072997a4b3ae5d5 |
Hashes for django_admin_export_action-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af4a940b6f4e1ad895f68e0ec46730deb478e2f2b270fb3a3209586bee2522d4 |
|
MD5 | 9cc6c55294961e18cc5126564989b246 |
|
BLAKE2b-256 | 70d63de41edcecae77b1019d2673459ec4eaca77bc903fc50a9959f266a13bd0 |