{ "info": { "author": "Jannis Leidel", "author_email": "jannis@leidel.info", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Utilities" ], "description": "django-sorter\n=============\n\n``django-sorter`` helps with sorting objects in Django templates without\nmodifying your views, can be used multiple times on the same page or\ntemplate, provides helpers to easily generate links and forms to switch\nthe sorting criteria (including the sort order) and has ~100% test coverage.\n\nQuickstart\n----------\n\n#. Get the app with your favorte Python packaging tool, e.g.::\n\n pip install django-sorter\n\n#. List this application in the ``INSTALLED_APPS`` setting.\n Your settings file might look something like::\n\n INSTALLED_APPS = (\n # ...\n 'sorter',\n )\n\n#. If it's not already added in your setup, add the ``request`` template\n context processor to the ``TEMPLATE_CONTEXT_PROCESSORS`` setting\n (you might need to `add it`_)::\n\n TEMPLATE_CONTEXT_PROCESSORS = (\n # ...\n 'django.core.context_processors.request',\n )\n\n#. Specify the allowed sorting criteria, for at least the default\n ``'sort'`` sorting querystring parameter::\n\n SORTER_ALLOWED_CRITERIA = {\n 'sort': ['first_name', 'creation_date', 'title'],\n }\n\n#. Add this line at the top of your template to load the sorting tags::\n\n {% load sorter_tags %}\n\n#. Decide on a variable that you would like to sort, and use the\n sort tag on that variable before iterating over it.\n\n ::\n\n {% sort objects as sorted_objects %}\n\n#. Optionally, you can display different sort links or forms::\n\n \n {% sortlink by \"first_name\" %}By first name{% endsortlink %}\n {% sortlink by \"creation_date,-title\" %}By creation date and title{% endsortlink %}\n ...\n \n\n The template tag takes a comma separated list of sorting statements.\n It also is a block tag and allows you to set the label of the generated\n link. The previous snippet will be rendered like this::\n\n \n By name\n By creation and title\n ...\n \n\n Similarly the ``{% sortform %}`` template tag renders a form instead of\n a simple link.\n\n.. _`add it`: https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://django-sorter.readthedocs.org/", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-sorter", "package_url": "https://pypi.org/project/django-sorter/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-sorter/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://django-sorter.readthedocs.org/" }, "release_url": "https://pypi.org/project/django-sorter/0.2/", "requires_dist": null, "requires_python": null, "summary": "A helper app for sorting objects in Django templates.", "version": "0.2" }, "last_serial": 1866539, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "bbea91afea3e53f6e6ed51a8e182b80f", "sha256": "4f3ac0fac9133fff9d9d112b6ee16837e1b54f03d302de676fe1e9a90fe32f9c" }, "downloads": -1, "filename": "django-sorter-0.1.tar.gz", "has_sig": true, "md5_digest": "bbea91afea3e53f6e6ed51a8e182b80f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7302, "upload_time": "2011-09-07T20:31:50", "url": "https://files.pythonhosted.org/packages/d9/4b/fd1627c7f8ea033aa4752ba02f7a15db074da4c9419c2f45300880f9aef7/django-sorter-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "c975bf5864fb3d153bf6af327536901c", "sha256": "6863b881e2c8ebb5cb84eeae6cbf1d0902298d2bc15c14af24856b9935e4f4ef" }, "downloads": -1, "filename": "django-sorter-0.2.tar.gz", "has_sig": true, "md5_digest": "c975bf5864fb3d153bf6af327536901c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9274, "upload_time": "2012-05-27T01:35:53", "url": "https://files.pythonhosted.org/packages/2e/71/1bdd7a1793c4edbec038442d9561ca1740fde40172f56bb13c34f7cb1bd7/django-sorter-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c975bf5864fb3d153bf6af327536901c", "sha256": "6863b881e2c8ebb5cb84eeae6cbf1d0902298d2bc15c14af24856b9935e4f4ef" }, "downloads": -1, "filename": "django-sorter-0.2.tar.gz", "has_sig": true, "md5_digest": "c975bf5864fb3d153bf6af327536901c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9274, "upload_time": "2012-05-27T01:35:53", "url": "https://files.pythonhosted.org/packages/2e/71/1bdd7a1793c4edbec038442d9561ca1740fde40172f56bb13c34f7cb1bd7/django-sorter-0.2.tar.gz" } ] }