Is there a way to customize the field name (not just label) while creating a ModelForm?
Eg. for the model:
class Book(models.Model):
title = models.CharField(max_length=256, db_index=True)
author = models.CharField(max_length=512, db_index=True)
published = models.DateTimeField(db_index=True)
the ModelForm can be:
class BookForm(forms.ModelForm):
fields = ('title', 'author')
Is there a way I can expose 'title' as 'book_name'? As in, the form HTML should have:
<tr><th><label for="id_book_name">book_name:</label></th><td><input id="id_book_name" type="text" name="book_name" maxlength="256" /></td></tr>
<tr><th><label for="id_author">Author:</label></th><td><input id="id_author" type="text" name="author" maxlength="512" /></td></tr>