I will start with the simple db employee from examples also i will use as starting point the web.py tutorial
First create a database and one table (insert one row)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import web | |
db=web.database(dbn='firebird',db='localhost:/tmp/test.fdb',user='sysdba',password='masterkey') | |
#this is a most to open transaction or else you will get cursor not open | |
t=db.transaction() | |
db.query("create table person (name varchar(255), email varchar(255))") | |
t.commit() | |
db.query("insert into person (name, email) values ('Random Name','example@example.com')") | |
t.commit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import web | |
db=web.database(dbn='firebird',db='localhost:/tmp/test.fdb',user='sysdba',password='masterkey') | |
#this is a most to open transaction or else you will get cursor not open | |
db.transaction() | |
result=db.query("select * from person") | |
#result=db.select('person') | |
print result[0] | |
Later we will create a grid like in the web.py group thread