views:

47

answers:

1

I know how to change or extend a model's views in the Django admin ( http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.add_view ) but I want to extend the admin index (dashboard) view.

Specifically, I want to keep it the same, but add some information to some of my models that will let me sort them into column 'A' or column 'B' depending on if the models are subclasses of model 'A' or model 'B'.

I've been able to change the index template no problem, but getting the models to sort into two columns as described seems like something I need to do in the view. I also don't want to have to rewrite the entire view, only extend it.

Thanks!

A: 

Why do you want to change the templates? You can use ModelAdmin.list_display for printig these columns.

Edit: And for ordering you can use ModelAdmin.ordering.

Sven Walter
Or did you mean the first page of Django-Admin? Where the Apps are listed?
Sven Walter
@SvenI'm talking about changing the index/dashboard page that appears when you first log into the backend and shows all installed apps and models. `list_display` affects the change list view for a specific model, not the index view for all apps and models.I need to change the template to make it easier for my clients to log into their site and change things. The default admin is very nice, but needs to be organized a little better for my app.
Lexo
What is about sorting by JavaScript like the list view from models? I think this is in change_list.html. I think this is easier...
Sven Walter
@Sven - As far as I can tell, the template does not know if any given model is a subclass of a specific model. Once I modify the view to pass this information to the template, I can work from there. My problem is extending this "index" view of the admin.
Lexo