Re: Form wizard problem

2008-06-04 Thread tyman26

Unless I am really mistaken, I am pretty sure this is a bug.  The
"self.step" variable in "wizard.py" is never being updated after the
forms are submitted.  These are two possible fixes I found:

1.  In the method "def __call__(self, request, *args, **kwargs) :"
update the self.step variable after checking if the form is valid.
 **Coding
 Revision:
  if form.is_valid():
   ..
   if next_step == num:
.
   else:
form = self.get_form(next_step)
current_step = next_step
self.step = current_step   #this would be the
newly added code

2.  In the method "def render_template(self, request, form,
previous_fields, step, context=None):" replace "self.step" with the
functions "step" argument value instead.
 Coding*
 Previous:
  context.update(self.extra_context)
  return render_to_response(self.get_template(self.step),
dict(context,...
 Revision:
  context.update(self.extra_context)
  return render_to_response(self.get_template(step),
dict(context,...

If anyone can verify that they have the same problem, I will submit
this to a bug fix.  Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Form wizard problem

2008-06-04 Thread tyman26

Hi,
  I am having a problem getting the form wizard to load a different
template for each form.  I used the example provided where they name
their templates template_0.html, template_1.html ... and so then
override the function like this:

def get_template(self, step):
return 'vlis/production/order/template_%s.html'  % step

I stepped through the code with a debugger and noticed that every time
it his "get_template(self, step)" the variable step always stays at
0.  Shouldn't this increment for every step in the form?  Not sure if
this is just me doing something wrong or possibly a glitch.  Any help
would be much appreciated.

Regards,

Tyson
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---