在code.py中声明如下数据库对象
db = web.database(dbn='mysql' , user='root' , pw='jackniang#2',db='YoO_database')
将数据库对象return到index.html模板
class index: def GET(self): notes = db.select('tab_note') return render.index(notes)
在index模板中接收
$def with (notes)
在页面遍历并通过超链接方式将单个记录结果传递给notepage页面
$for note in notes: <a href="/note?$note" >
慕侠2389804
相关分类