Export CSV reports of database views.
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.
Include the gifts URLconf in your project urls.py like this:
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.
- Switch to Python 3 only, factor out CSV and report filename generation.
- Fix installation error due to HISTORY.rst not being present in source.
- Fix SQL injection vulnerability relating to “view” argument.
- Update documentation.
- Rename PyPI package to django-view-export.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size django_view_export-0.6.0-py2-none-any.whl (7.3 kB)||File type Wheel||Python version py2||Upload date||Hashes View|
|Filename, size django_view_export-0.6.0-py3-none-any.whl (7.3 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size django-view-export-0.6.0.tar.gz (4.3 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for django_view_export-0.6.0-py2-none-any.whl
Hashes for django_view_export-0.6.0-py3-none-any.whl