I have a ModelField in Django. I want the user to be able to edit some of the fields but want to edit the others myself (not as admin but with values from the user’s state that’s accessible through Javascript). If I change the ModelField attribute “editable” to false then I can’t access when the user fills out the form. Is there a way to implement the “HiddenField” attribute that exists for regular Forms for ModelForms?
I can provide more details if needed.
If you have a custom template and view you may exclude the field and use
to get the value.
also you may prefer to use in the view:
It also can be useful: