[Zope3-Users] OOBtrees & ZODB

Shailesh Kumar shaileshk at gmail.com
Tue Jul 8 12:31:27 EDT 2008


BTreeContainer doesn't support site managers.

Folder is a subclass of SiteManagerContainer which is a subclass of
BTreeContainer.

You can happily use Folder here.

With regards,
- Shailesh



On 7/8/08, Tim Cook <timothywayne.cook at gmail.com> wrote:
>
> I am building a platform where I want to initialize the ZODB (that will
> be running under Zope) with three folders with sitemanagers.
>
> If I use Folders like this:
>
> if 'AR' not in root['Application']:
>    root['Application']['AR']=folder.Folder()
>    sm = LocalSiteManager(root['Application']['AR'])
>    root['Application']['AR'].setSiteManager(sm)
>    transaction.commit()
>
> it works great and I can then add initial objects to the folders.
>
> But, these folder sill potentially contain tens of thousands of objects
> so I really want to use BTree Folders.  But when I do this:
>
> from zope.app.container.btree import BTreeContainer
>
> ... <lots of other stuff>
>
> if 'AR' not in root['Application']:
>    root['Application']['AR']=BTreeContainer()
>    sm = LocalSiteManager(root['Application']['AR'])
>    root['Application']['AR'].setSiteManager(sm)
>    transaction.commit()
>
> I get this:
>
> File
> "/home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/atbldr/atbldr.py",
> line 78, in ?
>    root['Application']['AR'].setSiteManager(sm)
> AttributeError: 'BTreeContainer' object has no attribute
> 'setSiteManager'
>
> So BtreeContainers don't have a siteManager.
>
> I would like to OOBTree but I have been unable to even discern the
> proper way to import it.
>
> Thanks.
>
> Tim
>
>
>
>
>
> --
> Timothy Cook, MSc
> Health Informatics Research & Development Services
> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
> Skype ID == timothy.cook
> **************************************************************
> *You may get my Public GPG key from  popular keyservers or   *
> *from this link http://timothywayne.cook.googlepages.com/home*
> **************************************************************
>
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20080708/9adb8d94/attachment-0001.html


More information about the Zope3-users mailing list