Skip to main content

A project that helps sorting querysets in a specific order

Project description

=============================
Django Reorder
=============================

.. image:: https://badge.fury.io/py/django-reorder.png
:target: https://badge.fury.io/py/django-reorder

A project that helps sorting querysets in a specific order

Documentation
-------------

The full documentation is at https://django-reorder.readthedocs.org.

Quickstart
----------

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.

Features
--------

* 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 runtests.py

Credits
---------

Tools used in rendering this package:

* Cookiecutter_
* `cookiecutter-djangopackage`_

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage




History
-------

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.

Source Distribution

django-reorder-0.2.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

django_reorder-0.2.1-py2.py3-none-any.whl (4.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-reorder-0.2.1.tar.gz.

File metadata

File hashes

Hashes for django-reorder-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9ccfc596e5268e7e5dd4a1cb8ec6c37da77074eb85b4ef9f0ddde0cef140f86a
MD5 a3065f97fae3896c0003e8d88af8e7e0
BLAKE2b-256 564b8a4842cdf662d698a39af346d034bb1f237d759ed691ada5e3531135af0d

See more details on using hashes here.

File details

Details for the file django_reorder-0.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_reorder-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 da43674ddee275fae19741b7b12ed772cd3329ebb5262aa2b47327ead2e0354d
MD5 9dcacc0ba0023f7d37cf0294ae1813ba
BLAKE2b-256 26e592390baec11b5a747bdbb7fec0769937921d0a6195f6929b23375f8e9ef3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page