django admin - add custom form fields that are not part of the model

后端 未结 5 1215
无人及你
无人及你 2020-11-30 18:07

I have a model registered in the admin site. One of its fields is a long string expression. I\'d like to add custom form fields to the add/update page of this model in the a

5条回答
  •  悲哀的现实
    2020-11-30 18:43

    you can always create new admin template , and do what you need in your admin_view (override the admin add url to your admin_view):

     url(r'^admin/mymodel/mymodel/add/$' , 'admin_views.add_my_special_model')
    

提交回复
热议问题