except KeyError: print("this was not a key error?")

M

Michel Alexandre Salim

http://code.google.com/p/appwsgi/source/browse/appwsgi/wsgi/order.wsgi

I screwed up some sql statement

INSERT INTO orders (pid,uid,bid,time) VALUES (?,?,2,DATETIME('NOW'))",
(v['pid']),s.UID)

bid does not exist anymore, but why does the KeyError exception occur
when only my sql statement is wrong ?

Sure it's not from this line?

def stats2(db,v,s): db.execute("SELECT * FROM orders WHERE bid=? AND
uid=?",(v['bid'],s.UID))

It references v['bid']
 
G

gert

I screwed up some sql statement
INSERT INTO orders (pid,uid,bid,time) VALUES (?,?,2,DATETIME('NOW'))",
(v['pid']),s.UID)
bid does not exist anymore, but why does the KeyError exception occur
when only my sql statement is wrong ?

Sure it's not from this line?

def stats2(db,v,s): db.execute("SELECT * FROM orders WHERE bid=? AND
uid=?",(v['bid'],s.UID))

It references v['bid']

Hmm that is also a key error :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top