was fixed in 225 today
On Aug 21, 1:50 pm, "[email protected]" <[email protected]> wrote: > Hello Everybody, > > I will post the same code snippet twice to handle two completely > different questions. > > Here: > Since I checked out revision 2223 (and later) from launchpad via > bazaar, I get errors whenever any call to the redirect(...) function > is invoked. The message is: > > TypeError: 'XML' object is unsubscriptable > > Look at the function index() in the posted controller snippet. > With revision 2222 this redirects to test1 as expected. > > Thanks for helping! > > Best regards and greetings from sunny Bavaria, > Toni > > And here comes the code: > > 8<---- HEAD OF CODE -------------------------------- > > # One Issue: redirect does not work from launchpad revision 2223 on to > latest (2225) > def index(): > session.flash = T('Welcome to my web2py page!') > redirect(URL(request.application,'test', f='test1')) > > # And one Question: Validator IS_IN_SET(...) cannot handle language > specific special chars > # > # There allready were threads "Validators and non ASCII characters" > #http://groups.google.com/group/web2py/browse_frm/thread/db9dc637f1598... > # > # and "IS_IN_SET multiple=True with non-ASCII character failed" > #http://groups.google.com/group/web2py/browse_frm/thread/545ccff33c370... > # > # on groups.google.com. The second thread offered a solution, but it > seems to me not satisfying. Is there any other possibility to solve > this issue? > # > # What is the reason that the validators cannot handle non-ascii > characters (while python can...)? > > # compare test1() to test2() > > def test1(): > job_locationOptions = [ > u'Munich', > u'Germering', > u'Groebenzell', > ] > formA = SQLFORM.factory( > Field('job_LOCATION', > requires=IS_IN_SET(job_locationOptions), > default = job_locationOptions[0]), > ) > if formA.accepts(request.vars, session): > response.flash = 'form accepted' > > return dict(form = formA) > > def test2(): > job_locationOptions = [ > u'München', > u'Germering', > u'Gröbenzell', > ] > formB = SQLFORM.factory( > Field('job_LOCATION', > requires=IS_IN_SET(job_locationOptions), > default = job_locationOptions[0]), > ) > > if formB.accepts(request.vars, session): > response.flash = 'form accepted' > > return dict(form = formB) > > 8<---- TAIL OF CODE --------------------------------

