mando wrote:
> Hi!
>
> I'm trying to pass from sqlalchemy 0.5 to 0.6, but I found some
> trouble.
>
> This code, that run correctly with 0.5:
>
>
> def query(self, n):
>               class_name = n
>               #engine = self.connection()
>               Session = sessionmaker(bind=self.engine, autoflush=True,
> transactional=True)
>               session = Session()
>               query = session.query(class_name)
>               return query.all()
>
> return me this error:
>
>
> .....
> .......
>
> File "/Users/mac/.qgis//python/plugins/pyarchinitus/modules/db/
> pyarchinit_db_manager.py", line 92, in query
>     session = Session()
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/sqlalchemy/orm/session.py", line 180, in
> __init__
>     super(Sess, self).__init__(**local_kwargs)
> TypeError: __init__() got an unexpected keyword argument
> 'transactional'
>
> def query(self, n):
>               class_name = n
>               #engine = self.connection()
>               Session = sessionmaker(bind=self.engine, autoflush=True,
> transactional=True)
>               session = Session()
>               query = session.query(class_name)
>               return query.all()
>
> It's a change between 0.5 and 0.6? What part of the changelog I must
> to read?

the first thing would be to look at the warnings your 0.5 app generates:

>>> from sqlalchemy.orm import *
>>> s = sessionmaker(transactional=True)()
__main__:1: SADeprecationWarning: The 'transactional' argument to
sessionmaker() is deprecated; use autocommit=True|False instead.
>>>

next we have a list of ORM elements removed in 0.6.  'transactional' is
first in the list:
http://www.sqlalchemy.org/trac/wiki/06Migration#DeprecatedRemovedORMElements




>
> Thanks a lot
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/sqlalchemy?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.


Reply via email to