Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: DB

assigning db engine dynamically/conditionally in tests

 

 

Zope db RSS feed   Index | Next | Previous | View Threaded


robert at redcor

Jan 15, 2009, 10:10 PM

Post #1 of 1 (1585 views)
Permalink
assigning db engine dynamically/conditionally in tests

Hi there,
I am using z3c.saconfig and zope.sqlalchemy to access an relational db.

Now I would like to use a different db schema for the test than for the "real
thing".
I am usin a zcml stanza to define the the db:
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
xmlns:five="http://namespaces.zope.org/five"
xmlns:i18n="http://namespaces.zope.org/i18n"
xmlns:db="http://namespaces.zope.org/db"
i18n_domain="energiecluster">

<db:engine name="addresses.database" url="mysql://root [at] localhos/energie_3" />
<db:session name="energiecluster.addresses" engine="addresses.database" />

</configure>

here my questions:
Is there a way to load such a stanza conditionally?

or can I just assign a new new engine to a session?

or is there an other way to achieve my goal?

thanks
robert
_______________________________________________
Zope-DB mailing list
Zope-DB [at] zope
http://mail.zope.org/mailman/listinfo/zope-db

Zope db RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.