If i insert a new record on a db , insert return the id of the new record, 
foes it?
So, if i need to preces again the record, before db.commet(), i have to 
select the db by the new record id, which will give me a list of record 
(even if there is only one, being the id unique), then select the first 
record to proceed with update record. Or i am missing something? there 
isn't any shortcut for this stuff.
Example, suppose a table language with a column 'name'.

idPython=db.language.insert(name='Python')
dataset=db(db.language.id==idPython).select()
record=dataset[0]
record.update_record(...)
record.update_record(...)
ect

apart form joining the first 2 lines
dataset=db(db.language.id==db.language.insert(name='Pascal')).select()

there isn't a shortcut
record=db.langage.new(name='python')
record.update_record(name='ruby')
ect
?
what return insert if it fails? 0 ?

Thanks

-- 
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/groups/opt_out.

Reply via email to