我想自定义Django管理系统。对于添加,我已经做了这个:
class SomeAdmin(admin.ModelAdmin):
"""
Customized admin template and corresponding
views for adding media.
"""
add_form_template = "admin/add.html"
def add_view(self, request, form_url='', extra_context=None):
if request.method == "POST":
//YOur logic
return super(SomeAdmin,self).add_view(request)
它运作得很好。同样的,我如何获得自定义列表视图和自定义更改视图?
需要帮助吗?
change_form_template
和change_list_template
:https://docs.djangoproject.com/en/1.7/ref/contrib/admin/#django.contrib.admin.ModelAdmin.change_form_template - catavaran