Added parse_params() hook to FormWizard

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7263 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2008-03-17 15:53:01 +00:00
parent e461e737d3
commit b1dbff729f
1 changed files with 10 additions and 0 deletions

View File

@ -49,6 +49,7 @@ class FormWizard(object):
if 'extra_context' in kwargs: if 'extra_context' in kwargs:
self.extra_context.update(kwargs['extra_context']) self.extra_context.update(kwargs['extra_context'])
current_step = self.determine_step(request, *args, **kwargs) current_step = self.determine_step(request, *args, **kwargs)
self.parse_params(request, *args, **kwargs)
# Sanity check. # Sanity check.
if current_step >= self.num_steps(): if current_step >= self.num_steps():
@ -167,6 +168,15 @@ class FormWizard(object):
return 0 return 0
return step return step
def parse_params(self, request, *args, **kwargs):
"""
Hook for setting some state, given the request object and whatever
*args and **kwargs were passed to __call__(), sets some state.
This is called at the beginning of __call__().
"""
pass
def get_template(self, step): def get_template(self, step):
""" """
Hook for specifying the name of the template to use for a given step. Hook for specifying the name of the template to use for a given step.