On Fri, Aug 14, 2009 at 4:17 PM, Dustin<dustin.da...@gmail.com> wrote:
>
> Looks like you're not implementing the done() method required in
> FormWizard sub-classes.
> http://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/#creating-a-formwizard-class

It actually ended up being my CodeWidget being wonky, or some weird
assumptions that FormWizard makes, I'm not sure what's at fault here.

My CodeWidget class is trying to mimic the serial number entry for a
software product.  4 sets of 4 digits, here's the code:
http://dpaste.com/hold/80733/

It expects 4 different fields to be in the POST data, code_part0,
code_part1, code_part2, and code_part3.  value_from_datadict assembles
them into the full serial number, which looks something like this:

1111-2222-1111-2222

... which is what you get if you access form.cleaned_data['code']

This means that in the FormWizards sanity check at the end when it
tries to revalidate all the forms, it just passes
"code=1111-2222-1111-2222" into the form as the data instead of the 4
fields it's looking for, and the form no longer passes is_valid().

I made a simple check in value_from_datadict:

code = self.data.get(name, None)
if code: return code

I'm not sure if that's the correct way to go about it, but it's working for now.

-- 
Adam Olsen
SendOutCards.com
http://www.vimtips.org
http://last.fm/user/synic

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to