According to the form wizard docs, the initial data should be a static dict. But is it possible to provide initial data dynamically?
Here is my situation:
def get_context_data(self, form, **kwargs):
context = super(debugRegistrationWizard, self).get_context_data(form=form, **kwargs)
email = InvitationKey.objects.get_key_email(self.kwargs['invitation_key'])
context.update({'invitation_key': self.kwargs['invitation_key']})
return context
The email is what I want for initial data in step0, but I can only get this email in get_context_data method. How can I do that?
By the way: if the urlconf for formwizard.as_view accept argument like:
url(r'^registration/(?P<invitation_key>\w+)$', debugRegistrationWizard.as_view(FORMS)),
does it mean I have to pass a variable to my form's action attributes, because otherwise when I submit the form, I will get a not found url error.