当浏览器中的值更改时,如何刷新django管理表单? [英] How refresh django admin form when a value change in the browser?
本文介绍了当浏览器中的值更改时,如何刷新django管理表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个选择字段,当它更改为另一个值时,它必须更改表单中的其他字段。
I have a Choice Field that when changed to another value it must change other fields in the form.
因此,我需要刷新表单或就地更新带有ajax调用的字段。
So I need to refresh the form, or update in place the fields with a ajax call. Is this possible with the admin forms?
推荐答案
使用javascript在django admin中肯定有动态字段。
Its definitely possible to have dynamic fields in django admin using javascript.
举个好例子,我建议 django-smart-selects
和 django-admin-flexselect
。
For a good example, I would suggest django-smart-selects
and django-admin-flexselect
.
https://github.com/ digi604 / django-smart-selects
https://github.com/runekaagaard/django-admin-flexselect
这篇关于当浏览器中的值更改时,如何刷新django管理表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文