django-orderable
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:Simple object instance ordering for the Django administration change list. (Currently unmaintained and out of order.)
# django-orderable

Adds simple object instance ordering to the Django administration change list.

## Installation

Installing django-orderable is simple, just complete the following steps:

1. Clone the [django-orderable](http://github.com/tkaemming/django-orderable)
repository from [GitHub](http://www.github.com/).
2. Run `python setup.py install` to install the module package.
3. Add `orderable` to the `INSTALLED_APPS` tuple for your Django project.
4. Make sure the `orderable.js` file is served by your favorite web server.
5. For any models that you would like to be ordered through the change list, 
   have these models extend `orderable.models.OrderableModel`, and have their
   admin classes implement or extend `orderable.admin.OrderableAdmin`.
6. Make sure that in your ModelAdmin, the `list_per_page` attribute is set 
   to a value that is greater than the possible number of objects (this 
   attribute defaults to 100). If you're looking to order an inordinate number
   of model instances, you might want to look elsewhere for your ordering 
   solution.
   
### Adding Orderable Administration Inlines

You can also create orderable inlines in your administration site by creating
inlines that extend `orderable.admin.OrderableStackedInline` or 
`orderable.admin.OrderableTabularInline`.
  
## Usage

Please note that this isn't a fool-proof solution to ordering objects in
every scenario. However, this app _is_ useful for small applications where
the change list will not be paginated beyond the first page of model
instances. There are a lot of cases where this application isn't the
appropriate solution (at least currently), such as objects that are ordered
with respect to a related object, situations where the list_filter will be
implemented, etc.

## Test Server

The test application can be run with the `manage-tests.sh` script in the root
directory of the repository. (Please note that the script does need to be
executed with the root as the repository as `$PWD`, or else the `$PYTHONPATH`
environment variable will not be set correctly.) It takes any valid arguments
to the environment's `django-admin.py` command. When creating the database, it
creates a default superuser, with the username `admin` and password
`password`, as well as some test data to play with in the administration panel.

## Authors

* [Ted Kaemming](http://www.kaemming.com/)
* [Jannis Leidel](http://jezdez.me/)

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。