查询中出现web2py内部错误

2024-04-29 10:55:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我在web2py中测试mysql数据库,但在select查询中显示基本结果时没有什么问题

模型 博客页面.py

from gluon import DAL
from gluon import Field

db = DAL('mysql://root:@localhost/pythonblogdb')

db.define_table(
'blog_page',
Field('title', type='password'),
Field('content', type='string', writable=True, readable=True, default=''),
Field('publish_date', type='datetime', writable=True, readable=True, default=''),
)
db.commit()

控制器 def insert_blog():

rows = db(db.blog_page).select()
return dict(rows=rows)

视图 插入日志.html

{{extend 'layout.html'}}
{{=rows}}

我有个内部错误为什么


Tags: fromimporttruefielddbtypemysqlpage