I've tried to do this:
class editPage(forms.Form):
title = forms.CharField()
textContent = forms.CharField(widget=forms.Textarea(attrs={'class' : 'textContent'}))
def edit(request,name):
editForm = editPage()
editForm.fields["title"].initial = name
editForm.fields["textContent"].initial = util.get_entry(name)
return render(request, "encyclopedia/edit.html", {
"editForm": editPage(),
})
Everything works correctly, but the values doesn't show in the template. What I should do?
Thanks in advance!