I am unable to update .
In view its throwing issue: only row.update_record() code throwing
error. unable to capture in view
Please let me know if there is any issue below code:
def update_timesheet():
totalrecords=0;
i=0;
rows = db(
(db.ActivityMapping.resource_id==db.auth_user.id)&
(db.ActivityMapping.activity_date==request.vars.activity_date)&(db.auth_user.id==auth.user.id)
).select(db.ActivityMapping.org_id,db.ActivityMapping.solution_id,db.ActivityMapping.activity_id,db.ActivityMapping.effort)
for u in request.vars.org_id:
totalrecords=totalrecords+1
if totalrecords == 1:
rows.update_record(org_id=int(request.vars.org_id),solution_id=int(request.vars.solution_id),activity_id=int(request.vars.activity_id),effort=int(request.vars.effort))
elif totalrecords>1:
for m in request.vars.org_id:
rows.update_record(org_id=int(m),solution_id=int(request.vars.solution_id[i]),activity_id=int(request.vars.activity_id[i]),effort=int(request.vars.effort[i]))
#rows.update_record(effort=100)
i=i+1
return rows
On Thu, Aug 11, 2016 at 1:53 AM, Dave S <[email protected]> wrote:
>
>
> On Wednesday, August 10, 2016 at 3:52:20 AM UTC-7, madhu nomula wrote:
>>
>> Yes totalrecords decalred.
>>
>> Updated the code like below in controller: But still throwing issue
>>
>
> What issue is thrown? Do you get a ticket, or wrong results?
>
> /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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.