{ "info": { "author": "Danilo Bargen", "author_email": "gezuru@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "django-simplepaginator\n======================\n\ndjango-simplepaginator is a small wrapper around the standard Django paginator. The goal of\ndjango-simplepaginator is _not_ to replace the Django paginator with yet another kind of pagination\ninterface. It just simplifies the creation of a pagination and provides templates for column\ntitles and page navigation. It supports sorting and orphans.\n\nInstallation\n------------\n\nCopy the simple_paginator folder to your project or install it into your pythonpath:\n\n # python setup.py install\n\nIf you use pip, you can also install it directly using the -e parameter:\n\n # pip install -e git://github.com/dbrgn/django-simplepaginator.git#egg=simple_paginator\n\nThen add simple_paginator to your `INSTALLED_APPS` setting.\n\nUsage\n-----\n\nThe SimplePaginator object accepts the following keyword arguments:\n\n* `request` -- The request object\n* `prefix` -- The prefix for the controls' css-class and for the GET parameters\n* `data` -- Elements to paginate\n* `columns` -- A tuple of tuples containing column name and key (default None)\n* `per_page` -- How many elements to display per page (default 20)\n* `orphans` -- Whether to move orphans to the previous page (default 1)\n\nIn the view, use the `paginate()`-shortcutfunction to return pagination items. Remember that each\npagination on a page must have a distinct prefix.\n\nColumns can be marked as non-sortable by setting the sort key to `None`.\n\n### Example:\n\n```python\nfrom django.shortcuts import render_to_response\nimport simple_paginator\n\ntry:\n objects = models.Example.objects.filter(id__lte=100)\nexcept ObjectDoesNotExist:\n objects = None\n\nprefix = 'itemlist'\ncolumns = (\n ('Column1', 'modelfield1'),\n ('Column2', 'modelfield2'),\n ('Column3', None),\n)\nitems, order, baseurl = simple_paginator.paginate(request, prefix, functions, columns)\n\ncontext = {\n 'items': items,\n 'prefix': prefix,\n 'columns': columns,\n 'order': order,\n 'baseurl': baseurl\n}\nreturn render_to_response('template.html', context)\n```\n\nAnd in the template:\n\n```html\n

Pagination demo

\n

This pagination shows all Example objects with an id <= 100.

\n\n
\n \n {% include 'simple_paginator/paginator_header.html' %}\n {% for item in items.object_list %}\n \n \n \n \n \n {% endfor %}\n
{{ item.modelfield1 }}{{ item.modelfield2 }}{{ item.modelfield3 }}
\n\n {% include 'simple_paginator/paginator_control.html' %}\n
\n```\n\nIf the column/sorting feature is not used, some parts can be omitted:\n\n```html\n

Pagination demo

\n

This pagination lists some items.

\n\n
\n {% for item in items.object_list %}\n
{{ item }}
\n {% endfor %}\n\n {% include 'simple_paginator/paginator_control.html' %}\n
\n```\n\nCustomization\n-------------\n\nYou can customize the paginator header and control templates by copying them to your project\nfolder and editing them, or by adding completely new templates. They should be put in a\ndirectory called \"simple_paginator\" inside your template folder.\n\nPlease keep in mind that most of the control logic is done inside those templates, so be careful\nchanging them.\n\nChangelog\n---------\n\nv0.3.0 (2013-08-21)\n\n- [bug] Removed `
` from `paginator_header.html` template (#1)\n\nv0.2.2 (2011-09-07)\n\n- [add] Feature to mark columns as non-sortable\n\nv0.2.1 (2011-08-30)\n\n- [bug] Fixed compatibility with Python 2.5\n\nv0.2 (2011-08-26)\n\n- [add] Published django-simplepaginator on Github\n- [bug] Fixed critical bugs in view and templates\n- [bug] Fixed problems with setup.py\n\nLicense\n-------\n\nCopyright 2011-2013 Danilo Bargen (http://dbrgn.ch/)\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU\nLesser General Public License as published by the Free Software Foundation, either version 3 of the\nLicense, or any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\neven the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser\nGeneral Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License along with this program.\nIf not, see http://www.gnu.org/licenses/lgpl.html.\n", "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/dbrgn/django-simplepaginator", "keywords": "django simple pagination paginator", "license": "LGPLv3", "maintainer": null, "maintainer_email": null, "name": "simple_paginator", "package_url": "https://pypi.org/project/simple_paginator/", "platform": "any", "project_url": "https://pypi.org/project/simple_paginator/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/dbrgn/django-simplepaginator" }, "release_url": "https://pypi.org/project/simple_paginator/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "A simple wrapper around the Django paginator", "version": "0.3.0" }, "last_serial": 844940, "releases": { "0.3.0": [ { "comment_text": "", "digests": { "md5": "ce0eaf5aa7f18c43a2130b1bd13ab5f9", "sha256": "5e08f667d1c5f44b0fe6edfa8c46c039bfcdf89e6efe46401beba55840bcc4bd" }, "downloads": -1, "filename": "simple_paginator-0.3.0.tar.gz", "has_sig": false, "md5_digest": "ce0eaf5aa7f18c43a2130b1bd13ab5f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8381, "upload_time": "2013-08-21T11:13:31", "url": "https://files.pythonhosted.org/packages/01/12/b77aa33dad73ad21324c1f8ccdb46d172347cdd95380732c2adaf5bee966/simple_paginator-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ce0eaf5aa7f18c43a2130b1bd13ab5f9", "sha256": "5e08f667d1c5f44b0fe6edfa8c46c039bfcdf89e6efe46401beba55840bcc4bd" }, "downloads": -1, "filename": "simple_paginator-0.3.0.tar.gz", "has_sig": false, "md5_digest": "ce0eaf5aa7f18c43a2130b1bd13ab5f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8381, "upload_time": "2013-08-21T11:13:31", "url": "https://files.pythonhosted.org/packages/01/12/b77aa33dad73ad21324c1f8ccdb46d172347cdd95380732c2adaf5bee966/simple_paginator-0.3.0.tar.gz" } ] }