0

I'm testing mysql database in web2py but I have little problem on display a basic results in select query.

Models blog_page.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()

Controller def insert_blog():

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

Views inser_blog.html

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

I having an Internal error on this one why?

Roel John
  • 104
  • 2
  • 7

0 Answers0