{ "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