form._raw_value(fieldname) gone in Django 1.9

折月煮酒 提交于 2019-12-04 19:47:39

Looking at the source code, the _raw_value method is only 3 lines long, so it would be easy to add it as a function to your code.

def _raw_value(form, fieldname):
    field = form.fields[fieldname]
    prefix = form.add_prefix(fieldname)
    return field.widget.value_from_datadict(form.data, form.files, prefix)

Then change your code from form._raw_value(fieldname) to _raw_value(form, fieldname).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!