Knut Nesheim wrote: > Hi! > > We're trying to build a multi-page form using FormWizard. We need to > authorize the user first. In other views we use the user_passes_test > decorator, however the documented way of using FormWizard is to > include it directly in the urlconf: > > (r'^contact/$', ContactWizard([ContactForm1, ContactForm2])), > > How can we use decorators with this? > You can't. But remember, a decorator is only a shorthand for the application of a function to another function. So you *should* be able to use the following (though I haven't tested it):
(r'^contact/$', login_required(ContactWizard)([ContactForm1, ContactForm2])) > We've tried > > (r'^contact/$', @login_required(ContactWizard([ContactForm1, > ContactForm2]))), > > But it only gives > > Exception Type: TypeError at /order/add/ Exception Value: 'type' > object is unsubscriptable > > Any help is appreciated. I am absolutely amazed that you don't get a syntax error on that statement. regards Steve --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---