Multiple Form functionality is Broken ??

1 view
Skip to first unread message

Yannick

unread,
Jun 20, 2009, 3:50:27 PM6/20/09
to web2py Web Framework, Massimo Di Pierro
Hello mate,
I'm using the latest version 1.64.3 and some of my application
functionality that used to work before is not working anymore... I did
a routine testing on one of the page that contains multiple form here
is a sample of how I used to implement it with previous version of
Web2py....


@auth.requires_login() :
def pwdSetting(): return dict(chg_pwd = auth.change_password())

@auth.requires_login() :
from gluon.sqlhtml import form_factory
settingform = form_factory(
SQLField('firstname',label='First Name',
requires=IS_NOT_EMPTY
(),default=default_firstname),
..... )
if form.accepts(request.vars, session, keepvalues=True,
formname='settingform'):
# Some code
return dict(formsetting=settingform)


@auth.requires_login()
def index():
profileSet = profileSetting()
pwdSetting = pwdSetting()
return dict( profileSet=profileSet, pwdSet=pwdSetting)

###########
In the View "Index.html"
############
Profile Setting:
<form action="" enctype="multipart/form-data" method="post">
First Name:
<input name="firstname" type="text"
value="{{=profileSet["formsetting"].latest.firstname}}"/>
.....
<input type="submit" value="Submit" />

{{=profileSet["formsetting"].hidden_fields()}}
</form>

Password Setting:
<h1> Password Setting </h1>

<form action="" enctype="multipart/form-data" method="post">
Old Password:
<input name="old_password" type="password" value="" />
New Password:
...
...
<input type="submit" value="Submit" />
{{=pwdSet["chg_pwd"].hidden_fields()}}
</form>


Now using this code I can't save, the validation is not successful...
Did anyone of you had the same problem ?

Thanks for your help...

Cheers,
Yannick P.

mr.freeze

unread,
Jun 20, 2009, 10:23:32 PM6/20/09
to web2py Web Framework
What version of Python are you using?

Yannick

unread,
Jun 20, 2009, 11:59:18 PM6/20/09
to web2py Web Framework
Hello thnaks for the note,
I'm using python 2.5
Anyway idea ?
Thanks

mdipierro

unread,
Jun 21, 2009, 12:19:32 AM6/21/09
to web2py Web Framework
I see lots of errors in the first 4 lines:

@auth.requires_login() :
def pwdSetting(): return dict(chg_pwd = auth.change_password())
@auth.requires_login() :
from gluon.sqlhtml import form_factory

":" after decorators should not be there
the second decorator is not followed by a "def".

Because of these errors (perhaps due to cut and paste) I cannot help
with debugging. Please send the controller and view as a zipped
attachment.

Massimo

Yannick

unread,
Jun 21, 2009, 3:38:07 AM6/21/09
to web2py Web Framework
Oups actually is a copy and paste... I don't have ":" after the
decorators...

I just sent you a zip file containing the controller and view...

Thanks for your help !
Yannick P.

Yannick

unread,
Jun 24, 2009, 11:51:38 PM6/24/09
to web2py Web Framework
Hello Massimo,
Sorry to bother but was wondering if you figure out a solution for
this since the multiple form that used to work is now not working on
this new release...

Thanks,
Yannick P.

mdipierro

unread,
Jun 25, 2009, 12:02:41 AM6/25/09
to web2py Web Framework
Please email me this (again?) so that I can reproduce the problem.

Massimo

Trollkarlen

unread,
Jun 25, 2009, 8:53:11 AM6/25/09
to web2py Web Framework
Can this be the same problem as I described in the "web2py 1.64.3"
mail.

/R

Yannick

unread,
Jun 28, 2009, 11:56:24 AM6/28/09
to web2py Web Framework
Hi Massimo,
Sorry for the late reply... This scenario is still not working on the
latest Web2py... I just email you the application that will help
debugging...

Thanks,
Yannick P.
Reply all
Reply to author
Forward
0 new messages