Hasse's technical ramblings

a sysadm gotta do what...

Entries tagged “Ubuntu 10.10 sqlalchemy zine”

Zine blog fails after upgrade to Ubuntu 10.10(solution)

written by Alfafa, on Oct 16, 2010 6:52:00 PM.

Hi

I have just upgraded. The upgrade caused the python module sqlalchemy to be upgraded to a version which have some changes in its interface which is causing the Zone blog system to fail(I should mention that it is fixed in the development source).

I have run Zine from the source tarball and while I have seen there is now a Zine package in Ubuntu. I won’t switch to it right away because I am not running apache/lighttpd etc and I am using a wsgi-to-fastcgi wrapper which I am not sure if the in-repo package is handling(I probably would look at it in a virtual machine to test and see because in the long run it is easier to just use the “official” package)

But the solution to the changed interface is this. In the Zine file database.py (mine is /usr/lib/zine/zine/database.py) you have to find the line:

impl = sqlalchemy.Binary
change to
impl = sqlalchemy.LargeBinary
and find the line:
for name in 'delete', 'save', 'flush', 'execute', 'begin', 'mapper', \
            'commit', 'rollback', 'clear', 'refresh', 'expire', \
            'query_property':
and change to:
for name in 'delete', 'save', 'flush', 'execute', 'begin', 'mapper', \
            'commit', 'rollback', 'clear', 'refresh', 'expire', \
            'query_property':
The next line is:
setattr(db, name, getattr(session, name))
after that add:
# Some things changed names with SQLAlchemy 0.6.0
db.save = session.add
db.clear = session.expunge_all
And it should work again :-)