I have a form with which I want to update a MyModel object. On the model there is a unique_together constraint, fieldA together with fieldB. In the form in the clean method
I faced with similar problem and this is how I solved it.
I set field as hidden:
self.fields['fieldA'].widget.attrs['style'] = 'display:none;'
In template I show field value separately:
{{ form.fieldA.label_tag }}
{{ form.fieldA }}
{{ form.fieldA.value }}
{{ form.fieldA.errors }}
In case of fieldA is a select menu:
{{ form.fieldA.label_tag }}
{{ form.fieldA }}
{% for value, title in form.fields.fieldA.choices %}
{% if value == form.fieldA.value %}
{{ title }}
{% endif %}
{% endfor %}
{{ form.fieldA.errors }}