Skip to main content

A project that helps sorting querysets in a specific order

Project description

Django Reorder

.. image::

A project that helps sorting querysets in a specific order


The full documentation is at


Install Django Reorder::

pip install django-reorder

Then use it in a project::

from django_reorder.reorder import reorder

Tshirt.objects.order_by(reorder(size=['S', 'M', 'L']))

Some more detailed examples can be foind on the :doc:`usage` page.


* Can be used in ``order_by()`` and in ``annotate()`` calls.
* Works across relationships.
* Lets you control the sorting order of ``NULL`` values explicitly (otherwise
it can vary across databases).

Running Tests

Does the code actually work?


source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_test.txt
(myenv) $ python


Tools used in rendering this package:

* Cookiecutter_
* `cookiecutter-djangopackage`_

.. _Cookiecutter:
.. _`cookiecutter-djangopackage`:


0.2.1 (2016-09-13)

* Forgot to ``pull`` before I ``push``ed...

0.2.0 (2016-09-13)

* Added ``null_first()`` and ``null_last()`` shortcuts.

0.1.0 (2016-07-26)

* First release on PyPI.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-reorder, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size django_reorder-0.2.1-py2.py3-none-any.whl (4.6 kB) File type Wheel Python version 3.5 Upload date Hashes View
Filename, size django-reorder-0.2.1.tar.gz (5.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page