Hi

I was working on the a controller function where the end result was the row 
id following a 

def insert_record()
  id= db[f].insert(**data) operaton
  return id

As it turns out, this works without a hitch on my mac running python 2.7.10 
and Web2py Version 2.9.12-beta+timestamp.2015.01.12.21.00.43, while on a 
Centos 7 machine with python 2.7.5 and the head web2py Version 
2.12.3-stable+timestamp.2015.08.18.19.14.07, I could not for the longest 
time get the AJAX POST call to return the id of the inserted row from the 
Centos machine while it worked perfectly fine from my mac.

After much frustration, I am happy to share that I have resolved this by 
casting the return id into a string:

def insert_record()
  id= db[f].insert(**data) operaton
  return str(id)


Sharing this if it helps save some one else some time!

C

-- 
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/d/optout.

Reply via email to