i am starting to web2py and using shell for all db related stuff. today i notice a bizarre behavior on db select. Instead of selecting a record, it is insert value of last insert query. am i making any mistake here.. this my shell log: In [5] : for x in row: print x <Row {'id': 1L, 'name': 'dog'}> <Row {'id': 2L, 'name': 'bug'}> <Row {'id': 3L, 'name': 'y'}>
In [6] : db.dog.insert(name='hello') 4L In [7] : db(db.dog).select() <Rows (5)> In [8] : db(db.dog._id > 0).select() <Rows (6)> In [11] : rows = db(db.dog).select() In [12] : for x1 in rows: print x1 <Row {'id': 1L, 'name': 'dog'}> <Row {'id': 2L, 'name': 'bug'}> <Row {'id': 3L, 'name': 'y'}> <Row {'id': 4L, 'name': 'hello'}> <Row {'id': 5L, 'name': 'hello'}> <Row {'id': 6L, 'name': 'hello'}> <Row {'id': 7L, 'name': 'hello'}> In [13] : db._lastsql 'SELECT dog.id, dog.name FROM dog WHERE (dog.id > 0);' In [14] : db(db.dog).select() <Rows (10)> -- 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/d/optout.