from forms import MyContactForm
from django.views.generic.edit import FormView
class MyFormView(FormView):
template_name = 'my_forms.html'
form_class = MyContactForm
success_url = '/thanks/'
In meiner Vorlage, die Form wie folgt aufgerufen wird:Wie gibt man den Namen der Formularvariablen an, die in der Vorlage eines FormView verwendet wird? (Object_context_name für Formulare)
{{ form }}
Aber wie kann ich es so nennen:
{{ my_contact_form }}
?
Dies wäre das Formäquivalent von object_context_name
(für Modelle).
http://stackoverflow.com/questions/6907388/updating-context-data-in-formview-form-valid-method – catherine