[storm] Storm and Zope 3
Tim Stebbing
tjstebbing at gmail.com
Mon Jul 30 07:34:58 BST 2007
> > (Desperately looking for someone who knows how to do this and
> > is prepared to write it down for us mortals.)
> >
>
> Yes, That would be great.
add the storm package to your zope path <instance home>/lib/python
and setup the configs:
cd <zope instance home>
ln -s /path/to/storm lib/python/storm
echo "<include package='storm.zope'/>" >
etc/package-includes/storm.zope-configure.zcml
echo "<include package='storm.zope' file='meta.zcml'/>" >
etc/package-includes/storm.zope-meta.zcml
then, in your own app's configure.zcml, add a line like:
<store name="test" uri="sqlite:"/>
then in your code you can go:
from storm.zope.interfaces import IZStorm
from zope.app import zapi
zstorm = zapi.getUtility(IZStorm)
testStore = zstorm.get('test') #notice this matches your <store > zcml..
#do things with your store
this is off the top of my head and may be wildly inaccurate ;)
-tjs
More information about the storm
mailing list