Package: django-datatable-view
Datatable ViewThis package is used in conjunction with the jQuery pluginDataTables, and supports state-saving detection withfnSetFilteringDelay.  The package consists of a class-based view, and a small collection of utilities for rendering table data from models.Dependencies:Python 3.8 or laterDjango>= 2.2dateutillibrary for flexible, fault-tolerant date parsing.jQuery>= 2dataTables.js>= 1.10Getting StartedInstall the package:pipinstalldjango-datatable-viewAdd toINSTALLED_APPS(so default templates and js can be discovered), and use theDatatableViewlike a DjangoListView:# settings.pyINSTALLED_APPS=['datatableview',# ...]# views.pyfromdatatableview.viewsimportDatatableViewclassZeroConfigurationDatatableView(DatatableView):model=MyModelUse the{{ datatable }}provided in the template context to render the table and initialize from server ajax:<!-- myapp/mymodel_list.html --><!-- Load dependencies --><scriptsrc="https://code.jquery.com/jquery-3.3.1.min.js"integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="crossorigin="anonymous"></script><linkrel="stylesheet"href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"><scripttype="text/javascript"charset="utf8"src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script><!-- Load js for initializing tables via their server-side options --><scripttype="text/javascript"charset="utf8"src="{% static 'js/datatableview.js' %}"></script><scripttype="text/javascript">$(function(){datatableview.initialize($('.datatable'));});</script><!-- Render the table skeleton, includes the .datatable class for the on-ready initializer. -->{{ datatable }}Features at a glanceDatatableView, a drop-in replacement forListViewthat allows options to be specified for the datatable that will be rendered on the page.MultipleDatatableViewfor configurating multiple Datatable specifications on a single viewModelForm-like declarative table design.Support forValuesQuerySetexecution mode instead of object instancesQueryset caching between requestsCustomizable table headersCompound columns (columns representing more than one model field)Columns backed by methods or callbacks instead of model fieldsEasy related fieldsAutomatic search and sort supportTotal control over cell contents (HTML, processing of raw values)Search data fields that aren't present on the tableSupport for DT_RowDataCustomization hook for full JSON response objectDrop-in x-editable support, per-columnCustomizable table templatesEasy Bootstrap integrationAllows all normal dataTables.js and x-editable Javascript optionsSmall library of common column markup processorsFull test suiteDocumentation and Live DemosRead the module documentation athttp://django-datatable-view.readthedocs.org.A public live demo server is in the works.  For version 0.8, we will continue to keep the live demo site alive athttp://django-datatable-view.appspot.com/Please note that 0.8 does not reflect the current state or direction of the project.You can run the live demos locally from the included example project, using a few common setup steps.$gitclonehttps://github.com/pivotal-energy-solutions/django-datatable-view.git
$cddjango-datatable-view
$mkvirtualenvdatatableview(datatableview)$pipinstall-rrequirements.txt(datatableview)$datatableview/tests/example_project/manage.pymigrate(datatableview)$datatableview/tests/example_project/manage.pyloaddatainitial_data(datatableview)$datatableview/tests/example_project/manage.pyrunserverThe example project is configured to use a local sqlite3 database, and relies on thedjango-datatable-viewapp itself, which is made available in the python path by simply running the project from the distributed directory root.AuthorsAutumn ValentaSteven KlassCopyright and licenseCopyright 2011-2021 Pivotal Energy Solutions.  All rights reserved.Licensed under the Apache License, Version 2.0 (the "License");
you may not use this work except in compliance with the License.
You may obtain a copy of the License in the LICENSE file, or at:http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.