get_urls docs in ModelAdmin can be extended
|Reported by:||benc||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Description (last modified by )
It might help to explain three things regarding custom views in ModelAdmin
- The path in the example r'^my_view/$' will be accessed at /admin/myapp/mymodel/my_view/
- self.my_view in the example means that you probably want to define the view inside the MyModelAdmin Class so it has access to the ModelAdmin.
- my_view will be called with the request and the ModelAdmin instance as arguments:
def my_view(request, model_admin):
A simple class with get_urls and a view will be best.