{
"info": {
"author": "Max Syabro",
"author_email": "maxim@syabro.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Framework :: Django",
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3"
],
"description": ".. contents::\n\n======================\ndjango-tables2-reports\n======================\n\nFork of abondened https://github.com/goinnn/django-tables2-reports\n\n.. image:: https://travis-ci.org/goinnn/django-tables2-reports.png?branch=master\n :target: https://travis-ci.org/goinnn/django-tables2-reports\n\n.. image:: https://coveralls.io/repos/goinnn/django-tables2-reports/badge.png?branch=master\n :target: https://coveralls.io/r/goinnn/django-tables2-reports\n\n.. image:: https://badge.fury.io/py/django-tables2-reports.png\n :target: https://badge.fury.io/py/django-tables2-reports\n\n.. image:: https://pypip.in/d/django-tables2-reports/badge.png\n :target: https://pypi.python.org/pypi/django-tables2-reports\n\n.. image:: https://d2weczhvl823v0.cloudfront.net/goinnn/django-tables2-reports/trend.png\n :alt: Bitdeli badge\n :target: https://bitdeli.com/free\n\nWith django-tables2-reports you can get a report (CSV, XLS) of any `table `_ with **minimal changes** to your project\n\nRequirements\n============\n\n* `django `_ (>=1.3)\n* `django-tables2 `_ (>=0.11.0, tested with 0.14.0)\n* `xlwt `_ (>=0.7.5), `openpyxl `_ (>=1.6.2) or `pyExcelerator `_ (>=0.6.4.1) (These are optionals, to export to xls. Default to xlwt if available)\n\nIf you use python3, and you want export to xls use this version of the `xlwt (fork) `_ (0.8.0) if this `pull request `_ is not merged still , or use `openpyxl `_\n\n\nInstallation\n============\n\n* In your settings:\n\n::\n\n INSTALLED_APPS = (\n\n 'django_tables2_reports',\n )\n\n\n TEMPLATE_CONTEXT_PROCESSORS = (\n\n 'django.core.context_processors.static',\n\n )\n\n\n # This is optional\n\n EXCEL_SUPPORT = 'xlwt' # or 'openpyxl' or 'pyexcelerator'\n\nChanges in your project\n=======================\n\n1.a Now your table should extend of 'TableReport'\n\n::\n\n ############### Before ###################\n\n import django_tables2 as tables\n\n\n class MyTable(tables.Table):\n\n ...\n\n ############### Now ######################\n\n from django_tables2_reports.tables import TableReport\n\n\n class MyTable(TableReport):\n\n ...\n\n1.b If you want to exclude some columns from report (e.g. if it is a column of buttons), you should set 'exclude_from_report' - the names of columns (as well as property 'exclude' in `table `_)\n\n::\n\n class MyTable(TableReport):\n\n class Meta:\n exclude_from_report = ('column1', ...)\n ...\n\n2.a. If you use a traditional views, now you should use other RequestConfig and change a little your view:\n\n::\n\n ############### Before ###################\n\n from django_tables2 import RequestConfig\n\n\n def my_view(request):\n objs = ....\n table = MyTable(objs)\n RequestConfig(request).configure(table)\n return render_to_response('app1/my_view.html',\n {'table': table},\n context_instance=RequestContext(request))\n\n ############### Now ######################\n\n from django_tables2_reports.config import RequestConfigReport as RequestConfig\n from django_tables2_reports.utils import create_report_http_response\n\n def my_view(request):\n objs = ....\n table = MyTable(objs)\n table_to_report = RequestConfig(request).configure(table)\n if table_to_report:\n return create_report_http_response(table_to_report, request)\n return render_to_response('app1/my_view.html',\n {'table': table},\n context_instance=RequestContext(request))\n\n\nIf you have a lot of tables in your project, you can activate the middleware, and you do not have to change your views, only the RequestConfig import\n\n::\n\n # In your settings \n\n MIDDLEWARE_CLASSES = (\n\n 'django_tables2_reports.middleware.TableReportMiddleware',\n )\n\n ############### Now (with middleware) ######################\n\n from django_tables2_reports.config import RequestConfigReport as RequestConfig\n\n def my_view(request):\n objs = ....\n table = MyTable(objs)\n RequestConfig(request).configure(table)\n return render_to_response('app1/my_view.html',\n {'table': table},\n context_instance=RequestContext(request))\n\n\n2.b. If you use a `Class-based views `_:\n\n::\n\n ############### Before ###################\n\n from django_tables2.views import SingleTableView\n\n\n class PhaseChangeView(SingleTableView):\n table_class = MyTable\n model = MyModel\n\n\n ############### Now ######################\n\n from django_tables2_reports.views import ReportTableView\n\n\n class PhaseChangeView(ReportTableView):\n table_class = MyTable\n model = MyModel\n\n\nUsage\n=====\n\nUnder the table appear a CSV icon (and XLS icon if you have `xlwt `_, `openpyxl `_ or `pyExcelerator `_ in your python path), if you click in this icon, you get a CSV report (or xls report) with every item of the table (without pagination). The ordering works!\n\n\nDevelopment\n===========\n\nYou can get the last bleeding edge version of django-tables2-reports by doing a clone\nof its git repository::\n\n git clone https://github.com/goinnn/django-tables2-reports\n\n\nTest project\n============\n\nIn the source tree, you will find a directory called 'test_project'. It contains\na readily setup project that uses django-tables2-reports. You can run it as usual:\n\n::\n\n python manage.py syncdb --noinput\n python manage.py runserver\n\n\nReleases\n========\n\n0.0.10 (2014-10-13)\n-------------------\n* Fixes for xlsx Content-Type:\n * django-tables2-reports throws 500 Sever Error when report format is not recognized. 404 is more appropriate in this case.\n * django-tables2-reports sets Content-Type to application/vnd.ms-excel for xlsx files which causes warnings in Firefox. application/vnd.openxmlformats-officedocument.spreadsheetml.sheet is the correct Content-Type for xlsx\n* Support to Django 1.7 (I'm sorry to the delay)\n* Adding new feature: exclude_from_report\n* And a little details\n* Thanks to:\n * `Ramana Varanasi `_\n * `Mihas `_\n * `Paulgueltekin `_\n * `David Ray `_\n\n0.0.9 (2013-11-30)\n------------------\n* Compatible with the future version of Django (>=1.7)\n* Update the tests\n* Refactor the code\n* Fix a bug when the title of the sheet is longer than 31\n* Thanks to:\n * `Pavel Zaytsev `_\n\n\n0.0.8 (2013-11-14)\n------------------\n* `Refactor the csv_to_excel module `_. In the next release this package will be a pypi egg.\n* Support for `openpyxl `_\n* Integration with travis and coveralls\n* Fix an error if you use the theme paleblue\n* Fix test with python 3\n* Fix some details\n* Test project\n* Thanks to:\n * `Micha\u0142 Pasternak `_\n * `Mark Jones `_\n\n0.0.7 (2013-08-29)\n------------------\n\n* Russian translations\n* Thanks to:\n * `Armicron `_\n\n\n0.0.6 (2013-08-22)\n-------------------\n\n* Python3 support\n* Polish translation\n* Thanks to:\n * `Micha\u0142 Pasternak `_\n\n0.0.5 (2013-07-03)\n-------------------\n\n* Improvements in the README\n* Exportable to XLS with `xlwt `_\n* Thanks to:\n * `Crashy23 `_\n * `Gamesbook `_\n * And spatially to `Austin Phillips `_\n\n\n0.0.4 (2013-05-17)\n-------------------\n\n* Escape csv data correctly during output\n* The fields with commas now are not split into multiple columns\n* Thanks to:\n * `Austin Phillips `_\n\n0.0.3 (2012-07-19)\n-------------------\n\n* Fix a little error, when a column has line breaks. Now these are changed to espaces\n* Details\n\n0.0.2 (2012-07-18)\n-------------------\n\n* Add a default view (https://docs.djangoproject.com/en/dev/topics/class-based-views/)\n* Exportable to XLS\n* Update the README\n\n0.0.1 (2012-07-17)\n-------------------\n\n* Initial release",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/TriplePoint-Software/django-tables2-reports",
"keywords": "django,tables,django-tables2,reports,CSV,XLS",
"license": "LGPL 3",
"maintainer": null,
"maintainer_email": null,
"name": "tp-django-tables2-reports",
"package_url": "https://pypi.org/project/tp-django-tables2-reports/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/tp-django-tables2-reports/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/TriplePoint-Software/django-tables2-reports"
},
"release_url": "https://pypi.org/project/tp-django-tables2-reports/0.0.12/",
"requires_dist": null,
"requires_python": null,
"summary": "With django-tables2-reports you can get a report (CSV, XLS) of any django-tables2 with minimal changes to your project. Fork of abondened https://github.com/goinnn/django-tables2-reports",
"version": "0.0.12"
},
"last_serial": 2516092,
"releases": {
"0.0.12": [
{
"comment_text": "",
"digests": {
"md5": "bfcd8479be1b862356cce0db96e1dbf2",
"sha256": "461fff99d92004de52e4b8f54eed2ba4103ded7afb5dc125ddc2a7203afa1fcf"
},
"downloads": -1,
"filename": "tp-django-tables2-reports-0.0.12.tar.gz",
"has_sig": false,
"md5_digest": "bfcd8479be1b862356cce0db96e1dbf2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 22838,
"upload_time": "2016-12-13T11:27:20",
"url": "https://files.pythonhosted.org/packages/0f/94/3df5dd8801f36e2697e63909bb7d2e254693df20e7559228bb035cf243df/tp-django-tables2-reports-0.0.12.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "bfcd8479be1b862356cce0db96e1dbf2",
"sha256": "461fff99d92004de52e4b8f54eed2ba4103ded7afb5dc125ddc2a7203afa1fcf"
},
"downloads": -1,
"filename": "tp-django-tables2-reports-0.0.12.tar.gz",
"has_sig": false,
"md5_digest": "bfcd8479be1b862356cce0db96e1dbf2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 22838,
"upload_time": "2016-12-13T11:27:20",
"url": "https://files.pythonhosted.org/packages/0f/94/3df5dd8801f36e2697e63909bb7d2e254693df20e7559228bb035cf243df/tp-django-tables2-reports-0.0.12.tar.gz"
}
]
}