Django tables2 report
With django-tables2-reports you can get a CSV report of any table with minimal changes to your project
Requeriments
django-tables2 (>=0.11.0)
Installation
In your settings:
INSTALLED_APPS = (
'django_tables2_reports',
)
MIDDLEWARE_CLASSES = (
'django_tables2_reports.middleware.TableReportMiddleware',
)
Changes in your project
Now your table should extend of ‘TableReport’
############### Before ###################
import django_tables2 as tables
class MyTable(tables.Table):
...
############### Now ######################
from django_tables2_reports.tables import TableReport
class MyTable(TableReport):
...
Now you should use other RequestConfig:
############### Before ###################
from django_tables2 import RequestConfig
def my_view(request):
objs = ....
table = MyTable(objs)
RequestConfig(request).configure(table)
return render_to_response('app1/my_view.html',
{'table': table},
context_instance=RequestContext(request))
############### Now ######################
from django_tables2_reports.config import RequestConfigReport as RequestConfig
def my_view(request):
objs = ....
table = MyTable(objs)
RequestConfig(request).configure(table)
return render_to_response('app1/my_view.html',
{'table': table},
context_instance=RequestContext(request))
Usage
Under the table appear a CSV icon, if you click in this icon, you get a CSV report with every item of the table (without pagination). The ordering works!
Other way to use this application
You could not use the middleware and to change a little every view, you would get a more efficient code, but you would have to adapt every view
Releases
0.0.1 (2012-07-17)
Initial release
Metadata
Release files for django-tables2-reports 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-tables2-reports-0.0.1.tar.gz | 7.4 kB | Without provenance | Details for django-tables2-reports-0.0.1.tar.gz |
Release files / django-tables2-reports-0.0.1.tar.gz
| Download URL | django-tables2-reports-0.0.1.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3cddb1b8cfd51bba07119b2398068f34edd43d9e78a2172779e28544dfd2100f
|
|
BLAKE2b-256 checksum How to use checksums |
5ce9a589ba3dc16539c16644598a534c3c407ecd69900276227cd4073265538c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-tables2-reports 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.