Skip to main content

Django Order

Django app allowing users to manually order objects via admin.

Provides an additional order tool within admin with which objects can be ordered by any number of arbitrary settings defined fields. A user_order_by queryset method allows for retrieval of objects as they were ordered by users via admin.

Installation

  1. Install or add django-order to your Python path.

  2. Install django-object-tools as described here.

  3. Add order to your INSTALLED_APPS setting.

  4. Add an ORDERABLE_MODELS setting to your project’s settings.py file. This settings is a dictionary containing model-app label strings for those models you want to make orderable as keys. Values take the form of a tupple containing field names on which you want the relevant model to be orderable. I.e. to make the User model orderable for hypothetical home and users pages, add the following ORDERABLE_MODELS setting:

    ORDERABLE_MODELS = {
        'auth.User': ('home', 'users'),
    }

Usage

Admin

Once a model has been registered as orderable an additional Order object tool should be visible on the model’s change list view.

http://cloud.github.com/downloads/praekelt/django-order/django-order-tool.jpg

You can order your items using this tool for each field name specified for you orderable model.

Querysets

With the order app installed all queryset objects will have a new user_order_by method. This method behaves exactly the same as Django’s builtin order_by method except that it expects one of the settings defined field names for the model being queried. It will order the queryset based on the field name you provide. For example, to order users for the home page in our hypothetical example you would use the method as follows:

User.objects.all().user_order_by('home')

Authors

Praekelt Foundation

  • Shaun Sephton

Changelog

0.0.7 (2011-09-15)

  1. django-object-tools refactor.

0.0.6

  1. Tests, docs, cleanup, descending ordering, bugfixes.

0.0.5

  1. No longer use class_prepared signal.

0.0.4

#.Initial public release.

Metadata

Release files for django-order 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-order 0.0.7
File Size Uploaded
django-order-0.0.7.tar.gz 8.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for django-order 0.0.7
File Interpreter ABI Platform
django_order-0.0.7-py2.7.egg Legacy Egg format - - Details
django_order-0.0.7-py2.6.egg Legacy Egg format - - Details

Total release size: 39.8 kB

Release files / django-order-0.0.7.tar.gz

Download URL django-order-0.0.7.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6ea21fd8de38ab6a218ebd523455723c4950ca4ed4bb20462a1b04b57e5fb7a9
BLAKE2b-256 checksum
How to use checksums
9653650b3743cfde225b64f88ea87050254ab743d00e227c5413899a03fb8d1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_order-0.0.7-py2.7.egg

Download URL django_order-0.0.7-py2.7.egg
Size 15.9 kB
Tags Egg
SHA-256 checksum
How to use checksums
625c6ec488376b9a567b46f95c2049e411725bbbd3efa3293e00f3608b7667e7
BLAKE2b-256 checksum
How to use checksums
688e49afc9c0352d6d78285e2821e2af72492eae35db0c212c7572b59fa24d69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_order-0.0.7-py2.6.egg

Download URL django_order-0.0.7-py2.6.egg
Size 15.9 kB
Tags Egg
SHA-256 checksum
How to use checksums
8b41ec82ff4c279b5bc4fb3a33d44a1a9331c255f1bb306992a6b03a737b53ef
BLAKE2b-256 checksum
How to use checksums
42dc89624c16ec2bdb359869ad2a1479ae529d07ad9db2b82779f33eb9c543d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.7 This release

3 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page