1👍
✅
For show all fields try use __all__
in Meta:
class SolicitanteForm(ModelForm):
class Meta:
model = Solicitante
fields = '__all__'
For displaying the form fields is responsible widgets. So you need write own widget with necessary behavior.
In this post, author solved a similar problem, maybe it will be helpfull
0👍
You can use readonly
HTML attribute. It will make the input tabbable but not usable. In HTML:
<input type="text" name="congregacionOfertante" value="Cameroon" readonly>
You can custom you form as following for add the HTML attribute:
class SolicitanteForm(forms.ModelForm):
class Meta:
model = Solicitante
fields = ['congregacionOfertante', 'id_oferta', 'observaciones', 'descartado']
widgets = {
'congregacionOfertante': forms.TextInput({'readonly': 'readonly'})
}
If you don’t want it clickable/selectable use disabled
attribute.
👤Zulu
- [Answer]-Django get all, with related models
- [Answer]-Views VS App in Django?
- [Answer]-Django 1.7 migrations and flush
- [Answer]-Create new related object when updating one
- [Answer]-How to send a picture?
Source:stackexchange.com