9👍
✅
Within the AuthorForm
class you can set the labels
attribute which is a dictionary maps field name to label.
class InventoryModelForm(forms.ModelForm):
class Meta:
model = Inventory
fields = ['watercourse',]
widgets = {
'watercourse': forms.TextInput(attrs={
'class': 'form-control',
'placeholder': 'lorem ipsum',
}),
}
labels = {
'watercourse': 'Insert a watercourse',
}
- [Django]-How to stop server ran in Daemon mode in Django?
- [Django]-Django Forms – Many to Many relationships
- [Django]-ImportError: No module named 'models' in Python 3
- [Django]-How frequently should Python decorators be used?
- [Django]-How do I programmatically create a user with django_social_auth?
- [Django]-Google OAUTH gives 502 error
- [Django]-Choices in Django model not being translated, possibly due to use of modelform or modelformset?
Source:stackexchange.com