I am using inline formsets.
My model:
class Author(models.Model):
description = models.CharField(max_length=100)
class Book(models.Model):
author = models.ForeignKey(Author)
details = models.CharField(max_length=100)
class AuthorForm(ModelForm):
class Meta:
widgets = {
'description': Textarea(attrs={'cols': 40, 'rows': 4}),
}
In my views.py I made the form from the AuthorForm like so
form = AuthorForm(request.POST)
But I also made a formset for the Books
InlineFormSet = inlineformset_factory(Author, Books)
I cannot pass in a BooksForm with widgets, so how do I add a textarea widget to the book details.
Is it even possible? Am I missing something obvious?