Export CSV reports of database views.
Project description
Generate CSV reports by simply creating SQL views.
Authenticated staff members can then directly download these reports as CSV. It’s a nice agile way to deal with the changing requirements for reports.
Quick start
Include the gifts URLconf in your project urls.py like this:
url(r'^reports/', include('view_export.urls')),
Create an SQL view in your database:
=> CREATE VIEW v_staff AS ( -> SELECT first_name, last_name FROM auth_user -> WHERE is_staff = TRUE);
You’ll probably want to record this SQL in a file such as reports.sql or even better, add it to a Django migration.
Start the development server and visit http://127.0.0.1:8000/reports/staff/ or http://127.0.0.1:8000/reports/v_staff/ to download the SQL view named v_staff as a CSV file.
No settings are required by default and there’s no need to add the package to Django’s INSTALLED_APPS.
Release History
0.6.1 (2015-08-25)
Improvements
Switch to Python 3 only, factor out CSV and report filename generation.
0.5.5 (2015-08-25)
Bugfixes
Fix installation error due to HISTORY.rst not being present in source.
0.5.4 (2015-08-09)
Bugfixes
Fix SQL injection vulnerability relating to “view” argument.
0.5.3 (2015-08-05)
Improvements
Update documentation.
Rename PyPI package to django-view-export.
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_view_export-0.6.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e08aef405f57eb5198627856f2fd88ab3133c74efe1d513fdf2435b2ddcaf91e |
|
MD5 | da98401ef52b010e2ef41ddb36c8469b |
|
BLAKE2b-256 | b1fe7a187a4631dbd1abd0e9e0aeb86a0bf5058343f44aaa5d53e39a5b51fa18 |