Is any way to create hidden form field in CreateView form?
class CommentAdd(AjaxableResponseMixin, CreateView):
model = Comment
fields = ['author_name', 'text']
success_url = '/thanks/'
template_name = 'tree.html'
I have to pass some data (parent of comment) to the database. It works good with ModelForm, I pass parent with JS to the hidden field:
widgets = {'parent': widgets.HiddenInput}
How to do the same with CreateView form?