I'm looking to understand a way to change attribute of my html code generate by the django's template system, especially for Form html code.
So I found some stuff to change class from some models like that
class AuthorForm(ModelForm):
class Meta:
model = Author
fields = ('name', 'title', 'birth_date')
widgets = {
'name': Textarea(attrs={'cols': 80, 'rows': 20}),
}
coming from here. It's fine and it could works. But actually django, if I understand almost well, use a templates system which can be read by someone else, a front-end developper for a simple example. Now, Boostrap come whith the need to manipulate class attribute to work on the style. When we work on a loop, it's not a problem, but when whe generate the HTML code from a class who inerhit Form and just display it in a template, it will be be quickly harder for someone else to manipulate html balise. For sure they can do that with javascript, it's the solution that I've in mind, but it seem not really nice. There is an alternativ way to do that ?
Thanks for suggestion, I hope I was relatively clear.