Hello Michael,

> what I see immediately is that you're declaring mutliple  
> declarative_bases and multiple MetaData objects.   All of the Table  
> objects which relate to one another need to share the same underlying  
> MetaData object, and the declarative_base() function also uses a  
> MetaData object which it creates for you, unless one is passed.
>
> So you need a "global" module everyone works from which starts with  
> something like:
>
> meta = MetaData()
> Base = declarative_base(metadata=meta)
>
> then every Table uses the above "meta" as its "metadata" argument,  
> every declared mapped class inherits from Base.

Thank you kindly for this concept, I really appreciate your advice thus far.
I'm still struggling with this same challenge though, I've got a horrible
dose of n00bitus I'm afraid.

Above you talk about a global module in the application which creates the
Base and metadata, but I don't understand how these can then be accessed by
other classes around the application?

Do you have any good sample code or a link to a decent tutorial? Seems all I
can find are examples which are based on the idea that all the classes are
defined in the same module, which isn't practical.

I really appreciate the help Michael, thanks.

Heston


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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