Well, it seems I had to add db.cTable.cost.*default *to make it work and 
retrieve the default value, as db.cTable.cost is a field object. The case 
is now closed,then.

quarta-feira, 21 de Outubro de 2015 às 10:36:05 UTC+1, Carla Raquel 
escreveu:
>
> I'm trying to add(or update in case it isn't alreadythere) some records to 
> a db in a loop and I want to fill the entries with the sum of the default 
> db values with some other values, but somehow, when trying to insert,it's 
> not working. It's something like this:
>
>  db.cTable.update_or_insert((db.cTable.User == row.id)  & (db.cTable.Year 
> == int(datatemp[2])) &
>                             (db.cTable.Month == int(datatemp[1])), User = 
> row.id, 
>                 Year = int(datatemp[2]), Month = int(datatemp[1]), 
>                 cost = db.cTable.cost + data[t][0])
>
>
> Any ideas?
>

-- 
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.

Reply via email to