I agree, a change in a different controller cannot break the update controller.
In file gluon/sql.py please replace line raise SyntaxError, 'Object exists and cannot be redefined' with raise SyntaxError, 'Object %s exists and cannot be redefined' % key and let me know what the error looks like. It would also be useful to know with some confidence if a change in web2py triggered the error or a change in your code did it. Massimo On May 29, 9:52 am, NewBeen <[email protected]> wrote: > Sorry im testing with version 1.62 and don´t work to, > i don't get why this just stop to work. > > exactly the some code been working nice before!!! > the only thing i change is this. > > @auth.requires_login() > def customcreate(): > > try: > if session.create: > pass > except: > session.create=[] > > form = crud.create('databasedp',onaccept=lambda form: f(form)) > type(session.create) > > return dict(form=form) > > def f(form): > if session.create: > session.create.append(form.vars.id) > else: > session.create=[form.vars.id] > > but i don't see any connection! > > On May 29, 2:38 pm, mdipierro <[email protected]> wrote: > > > Just so that I understand, this works fine with 1.63 stable but not > > 1.63 intrunk? > > Seems like an odd error, can you email me your code so that I can do > > some debugging? > > > Massimo > > > On May 29, 9:21 am, NewBeen <[email protected]> wrote: > > > > This is working fine but when i update to the last version in the svn > > > start give this error > > > > ######## Error traceback ############# > > > > Traceback (most recent call last): > > > File "H:\python\web2py_win\web2py_source\svn\gluon\restricted.py", > > > line 107, in restricted > > > exec ccode in environment > > > File "h:\python\web2py_win\web2py_source\svn\applications > > > \Dominos_Times/views/default/list_all.html", line 62, in <module> > > > File "h:\python\web2py_win\web2py_source\svn\gluon\sql.py", line > > > 2215, in __iter__ > > > yield self[i] > > > File "h:\python\web2py_win\web2py_source\svn\gluon\sql.py", line > > > 2180, in __getitem__ > > > s = self._db(table.id == id), **a: update_record(t, s, a) > > > File "h:\python\web2py_win\web2py_source\svn\gluon\sql.py", line > > > 496, in __setattr__ > > > raise SyntaxError, 'Object exists and cannot be redefined' > > > SyntaxError: Object exists and cannot be redefined > > > > ############## end ################### > > > > And this is the function is giving the error > > > > ########### Controller Code ############## > > > > @auth.requires_login() > > > def customupdate(): > > > id_order=request.args[0] > > > crud_output=crud.update(db.databasedp, int(id_order) ,next=URL > > > (r=request,args=request.args[0])) > > > return dict(crudupdate=crud_output) > > > > ########### END ######################## > > > > ######## VIEW CODE ############# > > > > {{extend 'layout.html'}} > > > {{=form}} > > > > {{if query:}} > > > > <h2>You are checking Store{{=request.vars.store_id}} in > > > {{=request.vars.date}}</h2> > > > > <br/> > > > <br/> > > > > <table border="1" style="border-color: #FF9C00; border-collapse: > > > collapse; table-align: center;"> > > > <tr> > > > <th> Options </th> > > > <th> Order Numer </th> > > > <th> Store Number </th> > > > <th> Reason </th> > > > <th> Total Amount </th> > > > <th> Total Credit </th> > > > <th> Total Payd </th> > > > <tr> > > > > {{final_total_amount=0}} > > > {{for order in query:}} > > > > {{if order.total_amount:}} > > > {{final_total_amount+=order.total_amount}} > > > {{pass}} > > > > <td><a href={{=URL(r=request,f="customread",args=[order.id])}} > > > target="_blank">|Read|</a> > > > <a href={{=URL(r=request,f="customupdate",args=[order.id])}} > > > target="_blank">|Edit|</a></td> > > > > <td style="text-align: center;">{{=order.Order_id}}</td> > > > <td style="text-align: center;">{{=order.Store_id}}</td> > > > <td style="text-align: center;">{{=order.reason}}</td> > > > <td style="text-align: center;">{{=order.total_amount}}</td> > > > <td style="text-align: center;">{{=order.total_credit}}</td> > > > <td style="text-align: center;">{{=order.total_payd}}</td> > > > </tr> > > > > </br> > > > {{pass}} > > > </table> > > > > <p> </p> > > > <p> </p> > > > <p> </p> > > > <h1>Final Totals</h1> > > > </br> > > > > <h2> Number of orders {{=len(query)}}</h2> > > > <h2> Total Amount {{=final_total_amount}}</h2> > > > > ############# END ############### > > > > Can some one tell me why start to give me this error now? > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

