Hi Martin,

On 08/02/2011 19:25, Martijn Moeling wrote:

I am not sure I get your point. How do I set up a common "Base".

I could do Base= Declarative_base()

from a import A (or * not sure how this differs in this case)
from b import B (or *)

If I do not declare Base in module "a" I get an Import Error on class A(Base), 
the same for importing b.

The answer is you define your base somewhere and have both a and b import it from there.

This gets even more complicated when Base should be build from classes defined 
across modules.

...and then even more so when one base needs to be shared between multiple python packages ;-)

Any suggestions on how to tackle this.

I have a package I'm itching to release which will help with this.
Keep your eyes open for 'mortar_rdb' ;-)
(it's currently blocked on sqlalchemy-migrate getting a release and me doing some renaming from it's customer-specific internal name...)

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
           - http://www.simplistix.co.uk

--
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 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to