Reputation: 215
I have a form and need to change its field name with model value !
I have a model named "Documents" and it has two fields "type and path" ! Now am using model form to create the form
My question is when i display the form, the label of "path" is just "Path" but i need to change that to "type".
Upvotes: 0
Views: 402
Reputation: 8202
class MyForm( models.ModelForm):
class Meta:
fields=['type', 'path', ]
labels={'path':'type', }
# which will be Extremely Confusing, but you did ask...
Upvotes: 1