I have code which uses form._raw_value(fieldname)
.
This is gone in Django 1.9.
Is there a way to access the raw value in 1.9+?
Update
I am only migrating the code to Django 1.9. Up to now I have no deeper understanding of what's going on there in detail.
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)
.
来源:https://stackoverflow.com/questions/39348870/form-raw-valuefieldname-gone-in-django-1-9