I am trying to use formtools.preview.FormPreview after reading
http://www.djangoproject.com/documentation/form_preview/ and am
getting weird errors.
This is what I did,

1. Have a form called AddReviewForm which is working as expected.
2. Created a class
class ReviewPreviewForm(FormPreview):

    def done(self, request, cleaned_data):
        import pdb
        pdb.set_trace()
3. In my urls.py added this line
url(r'^post/$', ReviewPreviewForm(AddReviewForm),
name='reviews_preview'),
4. Changed template to post the form to '/post/'
5. Now I am expecting that the preview should appear on form posting,
but I am getting exception with traceback,

Traceback:
File "C:\Python25.1\lib\site-packages\django\core\handlers\base.py" in
get_response
  82.                 response = callback(request, *callback_args,
**callback_kwargs)
File "C:\Python25.1\lib\site-packages\django\contrib\formtools
\preview.py" in __call__
  31.         return method(request)
File "C:\Python25.1\lib\site-packages\django\contrib\formtools
\preview.py" in preview_post
  58.         f = self.form(request.POST, auto_id=AUTO_ID)

Exception Type: TypeError at /reviews/post/
Exception Value: __init__() takes at least 4 non-keyword arguments (2
given)

What am I doing wrong?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to