Django extend admin "index" view
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.Model开发者_开发问答Admin.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!
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.
精彩评论