Django - How to prepopulate admin form fields

前端 未结 7 1232
梦谈多话
梦谈多话 2020-12-08 14:54

I know that you can prepopulate admin form fields based on other fields. For example, I have a slug field that is automatically populated based on the title field.

H

相关标签:
7条回答
  • 2020-12-08 15:18

    The slug handling is done with javascript.

    So you have to override the templates in the admin and then populate the fields with javascript. The date thing should be trivial, but I dont know how you should get the logged in users name to the script (not that I have thought very hard but you get the drift :).

    0 讨论(0)
提交回复
热议问题