[Zope3-Users] SqlAlchemy

catonano adriano at euma.com
Thu Sep 14 13:31:57 EDT 2006

Hello zopers,

well this email is going to be quite long, I'm sorry I have many things to say

I saw the Zope 3 book, particulary the mapping (adapting) between the 
persistent objects defined there (a messageboard and a message 
objects) and some ftp files (and folders).

Now, I'd like to do the same with some, say, objects that are in a 
MySql database. I would love to realize a folders/files hierarchy 
that's mapped on my relational database !

I saw SqlAlchemy. It's impressive. I took a look at the Zalchemy code 
too, just to see wether I could borrow something.

I made a plan about how to achieve all this. I would like to expose 
it here and ask you, kind zopers, wether it's sane or there's 
something BIG I'm missing.

Because in the Zalchemy code I saw something I don't understand so I 
started to fear that there is something big I'm missing, indeed.

So, my plan is:

1) introduce all my tables and relationships between them. Something 
like users = Table('users', metadata, autoload = True)

and then overriding some table property where needed, also 
introducing some relationships, all what needed

2) define some interfaces as in the Zope 3 book, introducing 
containers and contained objects

3) define implementation classes for the interfaces that in their 
methods do something similar to what I saw in SQLAlchemyContainer, 
for example, which is, say,

    def __setitem__(self, name, item):
         session = z3c.zalchemy.getSession()  #in my case I still 
don't know where I'll take the session from

4) adapt these components to files, as in the book example

Could this be a good plan ?

Because in the Zalchemy code I saw a strange class, that is:

class AlchemyDataManager(object):
     """Takes care of the transaction process in zope.

shall I take care of this transaction process too ?

Because I know nothing about it and saw not so many docs about the 
internal Zope3 machinery.

Thanks so much for any hint

More information about the Zope3-users mailing list