On Fri, Dec 16, 2011 at 12:23 AM, Michael Merickel <[email protected]> wrote:
> In SQLAlchemy the "metadata" is the central object that binds tables
> together and describes their relationships. It is not possible to describe
> relationships between tables that are defined using different metadata
> objects. As you know already, each Base creates its own shared metadata
> object between all of its subclasses. If you really do want to share tables
> between addons you either need to define that table per-metadata-object, or
> share those particular objects via a common package.
>
> If you'd like to also share the mapper relationships then you'll need to
> share the Base subclasses (User, Product, etc). At that point you're running
> out of reasons not to just have your database schema in a common package
> that each of your addons depends on.

I think Viktor is talking about using third-party packages that have
their own base. You can't make them use your ancestor without forking
the package, or injecting a base class into the class at runtime,
which gets even more complicated if the class is using SQLAlchemy
magic -- you have to learn and understand the metaclass just to do it.

-- 
Mike Orr <[email protected]>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to