tags:

views:

20

answers:

1

Hello,

My problem is the following and it is related to the change list view of the admin interface.

I have a workorder model with several fields to caracterize the work order.

They are : type, nature, scheduling_type (and others).

When I see the list view, I would like to be able to change the filter (thus be able to create complex ones depending on the values of the different fields of the workorder model - the ones above and dates for example).

I have found post showing how to modify the default queryset (using managers for example) but I can't find a post that will use a value that is given in the url (ex. admin/workorder/planned_corrective). When the parameter planned_corrective is found, it must be used to select the appropriate queryset or manager and render the corresponding list.

As a add on, I want from that list to be able to use the standard admin options (like list filters, search ...) on that query.

Hope it is clear and thanks in advance for your help.

A: 

It sounds like you're after a RESTful interface.

You could accomplish much of this just by being clever with your urls.py - ie, defining admin/workoder/planned_corrective and every other possible parameter that could be encoded in the URL.

A lot of this can also be accomplished just by adding a get-absolute-url method to your models.

Or, you could the effort into using something like the django-rest-interface in your app.

James Polley