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.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.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

django_reorder-0.2.0-py2.py3-none-any.whl (4.5 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for django-reorder-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1639d240744e54fecb27ddf4b46b34999d88c2e591b7b404aad8af35c40f6ec3
MD5 4240e9510375998bce4cf14991401305
BLAKE2b-256 6c82fe9e77eb314d490f07e84e972be1611128bd1349d687e8a4ac7fbe4c04a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_reorder-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c7e8b5988a187721c92d546b03b819ffebeadd59cdcf76c98aec790710ebb114
MD5 ef423b0b764e567d44c34e197158149c
BLAKE2b-256 ee2b3c21384a17734bcc7e12566e32be76687f2c51cc2a90e759c8bf42145de0

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