I think onaccept has to be a function. On Thursday, April 21, 2011 1:12:24 PM UTC-4, 黄祥 wrote:
> hi, > > is it possible to create new record and update status simultaneously? > e.g. update() > def __add_2(): > form = crud.create(db.booking, next = URL(request.application, > request.controller, 'index'), onaccept = db.room(db.room.id == > request.vars.room_id).update(status = 'Booked')) > return dict(form = form) > > an error occured said: > AttributeError: 'NoneType' object has no attribute 'update' > > i've tried another (update_record): > def __add_2(): > form = crud.create(db.booking, next = URL(request.application, > request.controller, 'index'), onaccept = db.room(db.room.id == > request.vars.room_id).update_record(status = 'Booked')) > return dict(form = form) > > an error occured said: > AttributeError: 'NoneType' object has no attribute 'update_record' > > i know i was wrong, but i'm not understand where is my fault code, > could there anybody give me a pointer and shows me how to fix it? > > thank you so much before