{ "info": { "author": "Peter Schueler", "author_email": "peter@orangemirrorentertainment.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.1", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "# Django-Searchly-Tables\n\nA simple Django app that adds search and sort to HTML tables.\n\nI like using simple views, but it should work with class-based views as well (but I haven't tested it).\n\n## Example\n\nAdd `searchly_tables` to your `INSTALLED_APPS`:\n\n\tINSTALLED_APPS = (\n\t\t...,\n\t\t\"searchly_tables\",\n\t)\n\nIn your view.py, import searchly_tables, add a new table to a view,\nand specify for which model you would like to use it:\n\n\tfrom django.shortcuts import render\n\n\tfrom example.model import ExampleModel\n\tfrom searchly_tables.tables import SearchlyTable\n\n\tdef view(request):\n\t\ttable = SearchlyTable(module=\"exampleapp.models\", model=\"ExampleModel\", field_filters=field_filters)\n\t\ttable.labels = {'baseField1': 'labelForBaseField1', 'foreignkey_relationship': 'labelForForeignKeyRelationship', 'baseField2': 'labelForBaseField2'}\n\n\t\t# Optional links to models in fields\n\t\ttable.field_links = {'baseField2': ['app:view': 'url_parameter']}\n\t\tif request.POST:\n\t\t\ttable.post(request.POST, filter=True, sort=True)\n\t\treturn render(request, 'example/table.html', {'table': table})\n\nThen add the table to your template like this:\n\n\t
\n\t\t{% csrf_token %}\n\t\t{{ table.searchbar|safe }}\n\t\t\n\t\t\t{{ table.header|safe }} {{ table.body|safe }}\n\t\t
\n\t
\n\nAnd that's it! Naturally, you can change the appearance of the table by applying CSS.\n\nFor instance `table.attrs['td'] = 'my_td_class'` would result in `` on all td elements in the table.\nDjango-searchly-tables currently only supports classes; sorry, no direct styles as of yet.\nAlso no direct access to a single element by id for most elements; the sole exception is ``.\n\nHere's the list of elements I use in the table:\n\n> _thead_, _tbody_, _tr_, _th_, _td_, _input_, _button_, _select_, _option_\n\n## FAQ\n\n_Should I use this?_\n\nMaybe? Probably not?\n\nIt's a super basic app with very little fuzz. The code is still all over the place.\nIf that's for you, cool. If you need more options in your tabling(?),\nyou should check out [django_tables2](https://django-tables2.readthedocs.io).\n\n_Another table app? Haven't you heard about django\\_tables2? It's way better and has tons of features!_\n\nYep, I agree. I even linked to it in my earlier answer!\n\n_So, will this support feature X in the future? I really need that._\n\nProbably not? I'm happy with the way it works now, apart from some minor issues (=code cleanup/documentation).\nBut you're welcome to fork it, if you need feature X. Or use django_tables2 (seriously, it's great!).\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/peterschueler/django-searchly-tables", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "django-searchly-tables", "package_url": "https://pypi.org/project/django-searchly-tables/", "platform": "", "project_url": "https://pypi.org/project/django-searchly-tables/", "project_urls": { "Homepage": "https://github.com/peterschueler/django-searchly-tables" }, "release_url": "https://pypi.org/project/django-searchly-tables/0.1/", "requires_dist": null, "requires_python": "", "summary": "A simple Django app that adds search and sort to HTML tables.", "version": "0.1" }, "last_serial": 5207383, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "834cfcf4acd3e0cd1d73119713bc96dc", "sha256": "8749402746010c57221cba7a89ae434065e9367a09967eec8ba8c10f40756e60" }, "downloads": -1, "filename": "django_searchly_tables-0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "834cfcf4acd3e0cd1d73119713bc96dc", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6395, "upload_time": "2019-04-30T09:25:31", "url": "https://files.pythonhosted.org/packages/24/e1/156ad156ec2cdcf8bfa72137f25fbef44da16dd596a5e37a3c2d3be32671/django_searchly_tables-0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c0764a35cdff9eb8d614f62e3f223d56", "sha256": "c00a9b568ce0f857060612975cda8d6be290514916aa4d92644e5fff4dcf56b0" }, "downloads": -1, "filename": "django-searchly-tables-0.1.tar.gz", "has_sig": false, "md5_digest": "c0764a35cdff9eb8d614f62e3f223d56", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5578, "upload_time": "2019-04-30T09:26:03", "url": "https://files.pythonhosted.org/packages/23/51/649105ce5d6153737060d40adc2fe14c9e4dc668b367b17b10a070886f1d/django-searchly-tables-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "834cfcf4acd3e0cd1d73119713bc96dc", "sha256": "8749402746010c57221cba7a89ae434065e9367a09967eec8ba8c10f40756e60" }, "downloads": -1, "filename": "django_searchly_tables-0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "834cfcf4acd3e0cd1d73119713bc96dc", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6395, "upload_time": "2019-04-30T09:25:31", "url": "https://files.pythonhosted.org/packages/24/e1/156ad156ec2cdcf8bfa72137f25fbef44da16dd596a5e37a3c2d3be32671/django_searchly_tables-0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c0764a35cdff9eb8d614f62e3f223d56", "sha256": "c00a9b568ce0f857060612975cda8d6be290514916aa4d92644e5fff4dcf56b0" }, "downloads": -1, "filename": "django-searchly-tables-0.1.tar.gz", "has_sig": false, "md5_digest": "c0764a35cdff9eb8d614f62e3f223d56", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5578, "upload_time": "2019-04-30T09:26:03", "url": "https://files.pythonhosted.org/packages/23/51/649105ce5d6153737060d40adc2fe14c9e4dc668b367b17b10a070886f1d/django-searchly-tables-0.1.tar.gz" } ] }