try something like this:

record = db(db.choice.id == request.vars.cid).select().first()
record.update_record(votes=record.votes + 1)


On Mar 25, 4:10 am, Abhishek Mishra <[email protected]> wrote:
> I found this to be a little out of conventional way...
> Initially my app -http://hello-poll.appspot.comused to update tables
> in this way -
>
> method #1
> db(db.choice.id==request.vars.cid).update(votes = db.choice.votes + 1)
>
> ^ This worked well on local web2py and appengine instance.
>
> However on deploying on appspot the first method failed, the issue is
> now resolved and I'm updating values in this way -
>
> method #2
> record = db(db.choice.id==request.vars.cid).select()[0]
> db(db.choice.id==request.vars.cid).update(votes = record.votes + 1)
>
> Is it a known issue? or is method #1 a wrong way of doing this?
>
> Otherwise things were pretty smooth, and definitely a very easy
> deployment on gae.
>
> Thanks,
> Abhishek

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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.

Reply via email to