Hi Marcel,
Thanks for your quick answer.
I get rid of the apply=[pgsql] call. The view is rendered as wanted. But now, I can access the 'db' attribute to execute pgsql query to the database?
lib.install(pgsql)
@lib.route('/')
@bottle.mako_view('library/home')
def home():
.....
If I change def home(): to def home(db): then I get the error from bottle :
NameError("global name 'db' is not defined",)
Where as in the documentation it is defined as follow :
app.install(plugin)
@app.route('/show/:<item>')
def show(item, db):
db.execute('SELECT * from items where name="%s"', (item,))
row = db.fetchone()
if row:...
If I try like this
@lib.route('/:id')
@bottle.mako_view('library/home')
def home(id,db):
print "OK home "
print id
I get
TypeError('home() takes exactly 2 arguments (1 given)',)
I'm sorry but I'm really confused, getting my hairs out of my head :(
Thanks
Emmanuel