prepopulated_fields。
prepopulated_fields = {
'title': ('name',),
}
如何制作相同的功能但不进行音译。
例如:
name: Говядо
title: govyado
想要:
name: Говядо
title: Говядо
答案 0 :(得分:0)
admin.py
class Media:
js = ('/static/js/jquery.min.js',
'/static/js/slug.js')
slug.js
window.onload = function() {
document.getElementById("id_name").onkeyup = function() {
var e = document.getElementById("id_title");
if (!e._changed) { e.value = document.getElementById("id_name").value; }
}
}