Postgres
On 08/09/2013 05:15 AM, Christophe NINUCCI wrote:
Maybe it's a DBMS limitation ? Which one do you use ?
On 09/08/2013 02:57, Steven Brown wrote:
What the subject line says. From what I can tell, it's supposed to
return the primary key of the record that was just inserted. The
table does indeed have a primary key, so that's not the problem, but
I really don't know what could be. To make things really
complicated, the code for the insert function, found in db.py, itself
says that it returns the *record* that was just inserted, and then
you have to extract the right value. Unless, of course, the
db_cursor.fetchone()[0] call fails:
try:
out = db_cursor.fetchone()[0]
except Exception:
out = None
I tried delving deeper, to see what would cause that to fail, but got
lost trying to figure out whatever ctx is. I confess I'm pretty new
to python and web.py; I got used to strongly typed languages because
I started with C++, and without everything declared, I get lost easy :P
In any case, how do I get the primary key of the record just
inserted? Or a particular value of the record just inserted? I can
post code if that would help.
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/groups/opt_out.