Hello everybody, :)

In practice, I have a page (default/calculate.html) which in turn loads 
another page (forms/mansioni.load) by means of LOAD.
Here the code of the page* default/calculate.html*:
<!--some other HTML code here-->
<div>
    {{=LOAD('forms', 'mansioni.load', ajax=True)}}
</div>
<!--some other HTML code here-->

The page *forms/mansioni.load* contains just a form, as the following code 
shows.
{{=form}}

When I submit a form (correctly filled), I would like to redirect the 
parent page *(default/calculate.html*) to another page.
According to the online book, this seems to be possible by using the 
syntax"redirect(url,type='auto')". So I wrote the controller 
*forms.py* in this way:
def mansioni():
    form = SQLFORM.factory(
        Field('something', 'string', requires=(IS_NOT_EMPTY()))
    )
    if form.accepts(request, session):
        redirect(URL('default', 'someOtherPage', extension=False), 
type='auto')
    return dict(form=form)

Unfortunately, I get the following error:
TypeError: redirect() got an unexpected keyword argument 'type'

It looks like there is no such an argument for the method *redirect*.

The web2py version I am using is: 2.2.1 (2012-10-29 09:31:46) stable.
The application is running on GAE.

Some thoughts? :)

Best,
David

-- 



Reply via email to