{ "info": { "author": "Thiago Carvalho D Avila", "author_email": "thiagocavila@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "|Travis|_ |Python27|_ |PyPi|_\n\n.. |Travis| image:: https://api.travis-ci.org/staticdev/django-sorting-bootstrap.svg?branch=master\n.. _Travis: https://travis-ci.org/staticdev/django-sorting-bootstrap\n\n.. |Python27| image:: https://img.shields.io/badge/python-2.7-blue.svg\n.. _Python27: https://badge.fury.io/py/django-sorting-bootstrap\n\n.. |PyPi| image:: https://badge.fury.io/py/django-sorting-bootstrap.svg\n.. _PyPi: https://badge.fury.io/py/django-sorting-bootstrap\n\n\ndjango-sorting-bootstrap\n========================\n\nDjango-sorting-bootstrap is a pluggable mini-API to easy add sorting for querysets, links and table headers in Django_ templates. There is also a new tag that creates headers for sorting tables using `Bootstrap`_'s layout.\n\nInstallation\n------------\nTo install ``django-sorting-bootstrap`` simply run::\n\n pip install django-sorting-bootstrap\n\nConfiguration\n-------------\n\nInclude `sorting_bootstrap` in your `INSTALLED_APPS`\n\nPut `{% load sorting_tags %}` at top of your templates.\n\nYour templates have four tags available:\n\n`auto_sort`\n`sort_link`\n`sort_th`\n`sort_headers`\n\nBasic usage::\n\n {% auto_sort queryset %}\n {% sort_link \"link text\" \"field_name\" %}\n {% sort_th \"link text\" \"field_name\" %}\n {% sort_headers simpleschangelist %}\n \n\nauto_sort\n-------------------\nIt sorts the queryset in place and replaces the queryset by the sorted queryset.\n\nThis needs to be called prior to a slice has been taken from a queryset.\n(Ordering can not be done after the slice has been taken.) In particular this will\nnot work with generuc view `object_list`.\n\nBasic usage::\n\n {% auto_sort queryset %}\n\n\nsort_link\n-----------------\nSort link outputs a link which will sort on the given field. The field to sort on should be\na database field, or something which `.order_by` of queryset would work.\n\nBasic usage::\n\n {% sort_link \"link text\" \"field_name\" %}\n\nExample usage::\n \n {% sort_link \"Name\" \"name\" %}\n \nIt may also be used as::\n \n {% sort_link \"link text\" \"field_name\" \"vis_name\" %}\n {% sort_link \"Name\" \"name\" \"what\" %}\n \nThis is useful if you do not wnat to expose your database fields in urls.\n\n\nsort_th\n-------------------\nIt works the same way as sort_link, but the difference is the output template that renders a table header tag using `Bootstrap`_ classes and Glyphicons.\n\nBasic usage::\n\n {% sort_th \"link text\" \"field_name\" %}\n\n\nsort_headers\n-------------------\nThis function is somewhat more complicated to use, but it builds the whole table headers for sorting. In order to use it you have to pass in your view a SimplesChangeList (from sorting_bootstrap.views).\nLet's have an exemple using a view extending Generic ListView.\n\nBasic usage::\n\n from django.views.generic import ListView\n class MyView(ListView)\n def get_context_data(self, **kwargs):\n # Calls the base implementation first to get a context\n context = super(self.__class__, self).get_context_data(**kwargs)\n \n from sorting_bootstrap.views import SimpleChangeList\n # Gets the fields that are going to be in the headers\n list_display = [i.name for i in self.model._meta.fields]\n # Doesnt show ID field\n list_display = list_display[1:]\n cl = SimpleChangeList(self.request, self.model, list_display)\n # Pass a change list to the views\n context['cl'] = cl\n\nYou also need to call the function in your template::\n\n \n \n {% sort_headers cl %}\n \n \n\n\nCredits\n------------\n\nThis app is based on Agiliq's `django-sorting`_ 0.1. It has two improvements over it: the new tags and the Twitter Bootstrap compliance idea.\n\n.. _Django: https://www.djangoproject.com/\n.. _Bootstrap: http://getbootstrap.com/\n.. _django-sorting: http://github.com/agiliq/django-sorting", "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/staticdev/django-sorting-bootstrap", "keywords": null, "license": "LICENSE", "maintainer": null, "maintainer_email": null, "name": "django-sorting-bootstrap", "package_url": "https://pypi.org/project/django-sorting-bootstrap/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-sorting-bootstrap/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/staticdev/django-sorting-bootstrap" }, "release_url": "https://pypi.org/project/django-sorting-bootstrap/1.1.1/", "requires_dist": null, "requires_python": null, "summary": "Sorting templates API using sorting-bootstrap templatetags and Bootstrap classes.", "version": "1.1.1" }, "last_serial": 2137592, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "551f6118eee2f0bbf959577661f03a16", "sha256": "6bc679871561879b331c1218d2357cb82814f93cbf1886360d231d05bce56669" }, "downloads": -1, "filename": "django-sorting-bootstrap-1.0.0.tar.gz", "has_sig": false, "md5_digest": "551f6118eee2f0bbf959577661f03a16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8323, "upload_time": "2013-08-05T22:41:26", "url": "https://files.pythonhosted.org/packages/0c/47/a5ad3491f615c807b6130e02d57c6ec5a2ea9646c70a9a30b839518df052/django-sorting-bootstrap-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "cf347e1d31c0622a84112409caad4908", "sha256": "94ef9bf20e167d79b40120c742c0dba1a737ff764492bfce6aeea7b6137fa3d8" }, "downloads": -1, "filename": "django-sorting-bootstrap-1.0.1.tar.gz", "has_sig": false, "md5_digest": "cf347e1d31c0622a84112409caad4908", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8200, "upload_time": "2013-09-15T22:58:32", "url": "https://files.pythonhosted.org/packages/8d/18/f70732cfbef882529c1550e119c2fa88d667ebeecfb074d56fe59857f8e1/django-sorting-bootstrap-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "39278f92b4f9cbf14f31ad893b9ddfe1", "sha256": "fb471363bf47eae41e1afcf449bf276c6d32e2e29406bf398b9b4900d44cd58d" }, "downloads": -1, "filename": "django-sorting-bootstrap-1.0.2.tar.gz", "has_sig": false, "md5_digest": "39278f92b4f9cbf14f31ad893b9ddfe1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8350, "upload_time": "2013-09-16T00:45:30", "url": "https://files.pythonhosted.org/packages/62/73/748141612adecb644b0bac675183e599097cec584d972d4f069bf53e489b/django-sorting-bootstrap-1.0.2.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "708cdc26ac3ba3aad4d5ab9f49f5de25", "sha256": "43d69743c5b792cbfa907d8fdbed38ae72da9c539fdbc8bfa3e28fe77155126d" }, "downloads": -1, "filename": "django-sorting-bootstrap-1.1.tar.gz", "has_sig": false, "md5_digest": "708cdc26ac3ba3aad4d5ab9f49f5de25", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7790, "upload_time": "2015-01-09T20:37:26", "url": "https://files.pythonhosted.org/packages/29/83/95cca7dba79c2885fb43dea5d7c5c233c8a69b5a3a6a23deba4bbf8478a3/django-sorting-bootstrap-1.1.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "55fd7a8b7612c0d54cd91b78d77a1c15", "sha256": "8eae1d9894320a4ce87ccb04fbf589c783af36928b520bbfd262bca1c7d042ee" }, "downloads": -1, "filename": "django-sorting-bootstrap-1.1.1.tar.gz", "has_sig": false, "md5_digest": "55fd7a8b7612c0d54cd91b78d77a1c15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9488, "upload_time": "2016-05-27T22:34:38", "url": "https://files.pythonhosted.org/packages/4d/bb/3bef9e7605f5e3b44fcf158ff66508904a387cb3f2d0f76f0cb086b36baf/django-sorting-bootstrap-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "55fd7a8b7612c0d54cd91b78d77a1c15", "sha256": "8eae1d9894320a4ce87ccb04fbf589c783af36928b520bbfd262bca1c7d042ee" }, "downloads": -1, "filename": "django-sorting-bootstrap-1.1.1.tar.gz", "has_sig": false, "md5_digest": "55fd7a8b7612c0d54cd91b78d77a1c15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9488, "upload_time": "2016-05-27T22:34:38", "url": "https://files.pythonhosted.org/packages/4d/bb/3bef9e7605f5e3b44fcf158ff66508904a387cb3f2d0f76f0cb086b36baf/django-sorting-bootstrap-1.1.1.tar.gz" } ] }