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.
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)
Built Distribution
File details
Details for the file django-reorder-0.2.0.tar.gz
.
File metadata
- Download URL: django-reorder-0.2.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1639d240744e54fecb27ddf4b46b34999d88c2e591b7b404aad8af35c40f6ec3 |
|
MD5 | 4240e9510375998bce4cf14991401305 |
|
BLAKE2b-256 | 6c82fe9e77eb314d490f07e84e972be1611128bd1349d687e8a4ac7fbe4c04a3 |
File details
Details for the file django_reorder-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_reorder-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7e8b5988a187721c92d546b03b819ffebeadd59cdcf76c98aec790710ebb114 |
|
MD5 | ef423b0b764e567d44c34e197158149c |
|
BLAKE2b-256 | ee2b3c21384a17734bcc7e12566e32be76687f2c51cc2a90e759c8bf42145de0 |