[web2py] Re: REF: update_or_insert() confirming update

2014-01-09 Thread Massimo Di Pierro
update_or_insert returns the id of the new record or None if existing 
record was updated.

On Thursday, 9 January 2014 00:23:49 UTC-6, software.ted wrote:

 wanted to find out how to confirm that an update really took place 
 when using update_or_insert(), insert atleast returns the auto id but 
 a successful update seems to return none/null. 

 Any ideas? 

 -- 
 ...
  

 Teddy Lubasi Nyambe 
 Opensource Zambia 
 Lusaka, ZAMBIA 

 Cell: +260 97 7760473 
 website: http://www.opensource.org.zm 

 ~/ 
 Human Knowledge belongs to the world! - AntiTrust 

 Man is a tool-using animal. Without tools he is nothing, with tools he 
 is all - Thomas Carlyle 1795-1881 

 /~ 


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


[web2py] Re: REF: update_or_insert() confirming update

2014-01-09 Thread Anthony
If it doesn't return an id, that means no new insert was done, which means 
it did find a matching record and therefore updated it. Whether or not any 
fields in the matching record were actually changed depends on your inputs. 
Note, if more than one record matches the criteria, it will only update the 
first matching record.

Anthony

On Thursday, January 9, 2014 1:23:49 AM UTC-5, software.ted wrote:

 wanted to find out how to confirm that an update really took place 
 when using update_or_insert(), insert atleast returns the auto id but 
 a successful update seems to return none/null. 

 Any ideas? 

 -- 
 ...
  

 Teddy Lubasi Nyambe 
 Opensource Zambia 
 Lusaka, ZAMBIA 

 Cell: +260 97 7760473 
 website: http://www.opensource.org.zm 

 ~/ 
 Human Knowledge belongs to the world! - AntiTrust 

 Man is a tool-using animal. Without tools he is nothing, with tools he 
 is all - Thomas Carlyle 1795-1881 

 /~ 


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


Re: [web2py] Re: REF: update_or_insert() confirming update

2014-01-09 Thread Teddy Nyambe
Noted, thanx!
On 9 Jan 2014 16:52, Anthony abasta...@gmail.com wrote:

 If it doesn't return an id, that means no new insert was done, which
means it did find a matching record and therefore updated it. Whether or
not any fields in the matching record were actually changed depends on your
inputs. Note, if more than one record matches the criteria, it will only
update the first matching record.

 Anthony


 On Thursday, January 9, 2014 1:23:49 AM UTC-5, software.ted wrote:

 wanted to find out how to confirm that an update really took place
 when using update_or_insert(), insert atleast returns the auto id but
 a successful update seems to return none/null.

 Any ideas?

 --

...

 Teddy Lubasi Nyambe
 Opensource Zambia
 Lusaka, ZAMBIA

 Cell: +260 97 7760473
 website: http://www.opensource.org.zm

 ~/
 Human Knowledge belongs to the world! - AntiTrust

 Man is a tool-using animal. Without tools he is nothing, with tools he
 is all - Thomas Carlyle 1795-1881

 /~

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

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