3 messages in com.googlegroups.pylons-discussRe: AttributeError: 'Blog' object has...
FromSent OnAttachments
A. K.10 Dec 2007 22:12 
Mike Orr11 Dec 2007 16:31 
Mike Orr12 Dec 2007 01:30 
Subject:Re: AttributeError: 'Blog' object has no attribute 'session'
From:Mike Orr (slug@public.gmane.org)
Date:12/11/2007 04:31:04 PM
List:com.googlegroups.pylons-discuss

On Dec 10, 2007 10:12 PM, A. K. <bagera-rkaJxvC7ke8dnm+yROf@public.gmane.org>
wrote:

Hello there,

I am trying to follow the this link: http://wiki.pylonshq.com/display/ pylonscookbook/Making+a+Pylons+Blog to be able to write a basic blog application. I installed the following:

easy_install Pylons easy_install SQLAlchemy easy_install SAContext easy_install pysqlite

made all the changes as asked in the tutorial but I am getting the following error. Can somebody please take a look what I am missing? I surmise, something very basic but not able to debug and I am a complete newbie :(

File '/home/bagera/pylons/myblog/myblog/controllers/toolkit.py', line 32 in blog_add_process newblog_q.session.flush() AttributeError: 'Blog' object has no attribute 'session'

That should be model.sac.session.flush(). There's another flush line below that also has to be changed the same way.

That tutorial is way out of date. The update linked in the last comment is better: http://wiki.pylonshq.com/display/~gardsted/Making+a+Pylons+Blog+revisited OK, I'll get on revising the tutorial. The comments at the end of the update look correct. The only thing is, you don't need "session.flush()" anywhere because autoflush=True in the sessionmaker line.