[web2py] Re: REF: Server Error being returned after db insert

2013-05-21 Thread Massimo Di Pierro
def saveData():
insertID = db.mytable.insert(
field1= request.vars.field1,
field2 = request.vars.field2
)
return str(insertID) ### must return a string not a Reference object.



On Tuesday, 21 May 2013 07:44:11 UTC-5, software.ted wrote:

 I have this unusual behavior, this code adds data to the server quiet ok 
 but returns Server Error am expecting an integer

 *#Controller*
 *
 *
 def saveData():
 insertID = db.mytable.insert(
 field1= request.vars.field1,
 field2 = request.vars.field2
 )
 return insertID

 Data gets saved quiet well, but the insertID displays Server Error I was 
 thinking it returns an ID
 -- 

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

 /~ 


-- 

--- 
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: Server Error being returned after db insert

2013-05-21 Thread Teddy Nyambe
Geish!!! how could i have missed that Thanx!



On Tue, May 21, 2013 at 2:45 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 def saveData():
 insertID = db.mytable.insert(
 field1= request.vars.field1,
 field2 = request.vars.field2
 )
 return str(insertID) ### must return a string not a Reference object.



 On Tuesday, 21 May 2013 07:44:11 UTC-5, software.ted wrote:

 I have this unusual behavior, this code adds data to the server quiet ok
 but returns Server Error am expecting an integer

 *#Controller*
 *
 *
 def saveData():
 insertID = db.mytable.insert(
 field1= request.vars.field1,
 field2 = request.vars.field2
 )
 return insertID

 Data gets saved quiet well, but the insertID displays Server Error I
 was thinking it returns an ID
 --
 ..**..**
 ...
 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

 /~

  --

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






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

/~

-- 

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