Re: [web2py] Re: Helper functions to "get one" from database

2010-03-21 Thread Vasile Ermicioi
this what is doing replace in mysql http://groups.google.com/group/web2py/browse_thread/thread/4e1a673378cbac5/58560da01ed85fa7?lnk=gst&q=replace#58560da01ed85fa7 and because web2py returns the id on insert, there will be more intuitive to use that function there was a question about in web2py ma

[web2py] Re: Helper functions to "get one" from database

2010-03-21 Thread Richard
I have been using these related functions: def get_or_create(table, fields): """ Return ID of record from table with passed field values. Create record if does not exist. 'table' is a DAL table reference, such as 'db.person' 'fields' is a dict, such as {'paren