{ "info": { "author": "Stefan van der Haven", "author_email": "stefan@steeffie.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "django-pagination-plus\n======================\n\nThis template tag library is used for displaying pagination links in paginated\nDjango views. It exposes a template tag ``{% paginationplus %}`` that will take\ncare of iterating over the page numbers.\n\nUsage\n-----\n\nAdd ``paginationplus`` to your ``INSTALLED_APPS`` in your settings.\n\nAt the start of the template for your paginated view, use the following to load\nthe tag module: ::\n\n {% load paginationplus %}\n\nThen, at the position you want your pagination links to appear, use the\nfollowing block tag. ::\n\n {% paginationplus page_obj url_name url_arg1=... url_arg2=... %}\n ...\n {% endpaginationplus %}\n\nThe first argument passed to the opening tag is the ``Page`` object of your\npaginated view. The remaining arguments are the same as the arguments passed to\nthe built-in ``{% url %}`` tag, minus the argument that takes the value for the\npage number in the view, eg. ``page`` in the generic view ``ListView``.\n\nThe block iterates over the page numbers available from the ``Paginator`` object\nassociated with the ``Page`` object that is passed as the first argument to the\nopening tag.\n\nThe block's content is rendered once for each iteration, and within this block,\na template variable named ``paginationplus`` is available.\n\nThis template variable exposes four attributes:\n\n* ``number``\n The page number that is the subject of this iteration\n* ``url``\n Contains the url of the page for the page number currently iterated over.\n* ``is_filler``\n When this is True, the current iteration does not represent a page number,\n but instead represents a filler, ie. a hole in the sequence of page numbers.\n See below for more information.\n* ``is_current``\n When this is True, the current iteration represents number of the page that\n is currently displayed in the view.\n \nSingle tag usage\n----------------\n\nAn alternative to the block tag, is the following: ::\n\n {% paginationplus page_obj url_name url_arg1=... url_arg2=... ... with 'template/name.html' %}\n\nUsing ``with`` in the tag indicates that the iteration will not occur in a\nblock, but instead in the template that follows ``with``. Within this template,\nthe parent template's full context is available, with an added\n``paginationplus`` variable. The template passed to the tag needn't be a string,\nany available template variable will do.\n \nSettings\n--------\n\nBy default, paginationplus will support displaying the links for the first,\nprevious, current, next, and last page. For instance, if you have a paginated\nview with 99 pages, and the current page is page 30, the following sequence will\nbe iterated over: ``[1, None, 29, 30, 31, None, 99]``. Suppose the current page\nis page 3, the sequence will be ``[1, 2, 3, 4, None, 99]``.\n\nIn the above sequences, the ``None`` values represent a hole in the page number\nsequence, and for these holes, the ``paginationplus`` template variable will\nhave its ``is_filler`` attribute set to ``True``, the ``number`` and ``url``\nattributes will be set to ``None``, and ``is_current`` will be set to ``False``.\n\nTo disable this behavior, and iterate over all available page numbers, you can\nset the ``PAGINATIONPLUS_CONTIGUOUS`` setting to ``True`` in your project's\nsettings.\n\nTo control the number of page numbers before and after the current page that\nwill be iterated over, you can set the ``PAGINATIONPLUS_MAX_DISTANCE`` option.\n\nFor instance, when ``PAGINATIONPLUS_MAX_DISTANCE`` is set to 2, the following\nsequence will be iterated over when the number of pages is 99 and the current\npage is 30: ``[1, None, 28, 29, 30, 31, 32, None, 99]``. And when the current\npage is 3, the sequence will be ``[1, 2, 3, 4, 5, None, 99]``.\n\nExample\n-------\n\nSuppose you use a generic ``ListView`` in your application that exposes a list\nof objects of the ``Item`` model. Let's have a look at a possible urlconf: ::\n\n # urls.py\n from django.conf.urls import patterns, url\n from django.views.generic import ListView\n\n from exampleapp import models\n\n urlpatterns = patterns('',\n # ...\n url(r'^items/(?:page/(?P\\d+)/)?$', ListView.as_view(\n model=models.Item,\n template_name='items.html',\n paginate_by=5\n ), name='show_my_items'), \n )\n\nThe part that displays the items in the ``items.html`` template could then look\nlike this: ::\n\n {# items.html #}\n \n {# ... stuff ... #}\n \n \n \n \n\n {# ... stuff ... #}\n\nWhen this view is visited by a user, the HTML will look something like this: ::\n\n \n \n \n\nAnother possibility for displaying a page link is to use the following in the\ntemplate instead of the ```` tag and its contents: ::\n\n {{paginationplus}}\n\nThis will output an anchor tag containing the page number, with its href\nattribute set to the page's URL.", "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/SteefH/django-pagination-plus", "keywords": "django,pagination", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-pagination-plus", "package_url": "https://pypi.org/project/django-pagination-plus/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-pagination-plus/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/SteefH/django-pagination-plus" }, "release_url": "https://pypi.org/project/django-pagination-plus/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Utilities for pagination in Django templates", "version": "0.0.3" }, "last_serial": 790250, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a77ffef059b7cb363ad61bc0ae7c19bb", "sha256": "f126fe2df898d631dcaea10f2abf7423d5dd2653a0f8ab1ef1016202a4f2aa1c" }, "downloads": -1, "filename": "django-pagination-plus-0.0.1.zip", "has_sig": false, "md5_digest": "a77ffef059b7cb363ad61bc0ae7c19bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11899, "upload_time": "2012-06-07T20:44:56", "url": "https://files.pythonhosted.org/packages/87/96/62dddb719bbfc5625de830b557cb3cc13bce44231bdd772d881858b34423/django-pagination-plus-0.0.1.zip" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "fdb2233b5e3712e16c7164ee0bc2d984", "sha256": "bf41b5f558b4fbed68368adf99a7d367fac0e0c140504be734b96346ec7cb15d" }, "downloads": -1, "filename": "django-pagination-plus-0.0.2.zip", "has_sig": false, "md5_digest": "fdb2233b5e3712e16c7164ee0bc2d984", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14093, "upload_time": "2012-06-08T09:57:03", "url": "https://files.pythonhosted.org/packages/3a/83/1aadbbc949eff0134888e75dd0a330e0ec0e25409e6bb6d244d48b53e1d4/django-pagination-plus-0.0.2.zip" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "80aeaa758410f6b21aa14af51ddafe77", "sha256": "33e0e264a3808c241c4a3afb829fbb886c8edfe0236a0e1df105f5ffcdecc9d5" }, "downloads": -1, "filename": "django-pagination-plus-0.0.3.zip", "has_sig": false, "md5_digest": "80aeaa758410f6b21aa14af51ddafe77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14092, "upload_time": "2012-06-12T15:37:06", "url": "https://files.pythonhosted.org/packages/83/f0/435ab6594904d9f2768b29658cfc29684b6744e1200192a6115a610479ae/django-pagination-plus-0.0.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "80aeaa758410f6b21aa14af51ddafe77", "sha256": "33e0e264a3808c241c4a3afb829fbb886c8edfe0236a0e1df105f5ffcdecc9d5" }, "downloads": -1, "filename": "django-pagination-plus-0.0.3.zip", "has_sig": false, "md5_digest": "80aeaa758410f6b21aa14af51ddafe77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14092, "upload_time": "2012-06-12T15:37:06", "url": "https://files.pythonhosted.org/packages/83/f0/435ab6594904d9f2768b29658cfc29684b6744e1200192a6115a610479ae/django-pagination-plus-0.0.3.zip" } ] }