On Wednesday, October 14, 2015 at 5:31:59 PM UTC-7, Dave S wrote: > > > > On Wednesday, October 14, 2015 at 3:27:31 PM UTC-7, Alex Glaros wrote: >> >> does anyone see anything wrong with the update syntax? >> >> def utility_change_column_name(): #used once in a while by programmer. >> Not used by users. >> for r in db.PostalCode: >> > Oh, getting all the column names, er, field names. Is countryCode a column name?
> db(db.PostalCode).update(r.countryCode = r.countryCodeFromGeoNames) >> > > shouldn't this be "db(db.PostalCode).update(countryCode = > r.countryCodeFromGeoNames)" ? > I guess not. Can you use update() to modify column names? Or just the contents of the field? /dps > > >> return dict() >> >> am getting >> <type 'exceptions.SyntaxError'> keyword can't be an expression >> >> File "C:\alex\alt_web2py\web2py\gluon\restricted.py", line 209, in compile2 >> return compile(code.rstrip().replace('\r\n', '\n') + '\n', layer, 'exec') >> File "C:/alex/alt_web2py/web2py/applications/ES1/controllers/default.py" >> <http://127.0.0.1:8000/admin/default/edit/ES1/controllers/default.py>, line >> 5924 >> db(db.PostalCode.id).update(r.countryCode = r.countryCodeFromGeoNames) >> SyntaxError: keyword can't be an expression >> >> > /dps > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.