1👍
✅
Something like this should work:
def __init__(self, *args, **kwargs):
hidden_widget = forms.HiddenInput()
self.fields['hidden_field'] = forms.CharField(widget=hidden_widget)
0👍
It’s not in the offical docs , If I remember correctly but this should work.
Render both fields as hidden:
{{ form.field_name.as_hidden }}
You could also set it’s widget to a hidden field (HidenInput): https://docs.djangoproject.com/en/dev/ref/forms/widgets/
- [Answer]-Update Multiple Objects using SQL way in Django
- [Answer]-Force admin to show app regardless of permissions
- [Answer]-Tracking of field changes in Django
Source:stackexchange.com