> Hey list, are you confused by the current system ?  Please let me know.
> the only change I would favor here would be to merge "connect" into
> MetaData, BoundMetaData and DynamicMetaData stay around for backwards
> compat for probably forever.

Not actually confused by the system. Since I need to define the connection 
parameter in a seperate file (config file), I *need* the DND.connect() 
method. So, DND is the only I use... The global_connect() is not useful for 
me since I need multiple datasources. Again, beeing able to define connection 
parameter later is crucial, so having a MetaData.connect() would be great.

>but I need to get at least 20 or 30 users on this list telling me how  
> they are using metadata.

A typical initialization of my models looks like:

_metadata = DynamicMetaDate("I'll be bound later...")
one_table = Table("blabla",_metadata, ...)

_engine = None
def init_model(dburi,**kwargs):
    global _engine
    if _engine:
        # Engine already defined
        # check if metadata bound
        if _metadata.is_bound():
            # nothing to do   
            pass
        else:
            # need to connect metadata.
            # occurs when starting new thread
            _metadata.connect(_engine)
    else:
       # first we access the model, init everything
        _engine = sa.create_engine(dburi,**kwargs)
        settlement_metadata.connect(_engine)



BTW, I'd posted on the TG list to know how they handle multiple datasources 
with SA. Answer was "for now, only one datasource [probably due to 
global_connect], we'll see next release)". So maybe global_connect will not 
even be used anymore by TG...


Cheers


Seb
-- 
Sébastien LELONG
sebastien.lelong[at]sirloon.net
http://www.sirloon.net


--~--~---------~--~----~------------~-------~--~----~
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