Folder uses an OOBTree to store it's data, so it should be ok. But if you want to use BTreeContainer and have it work as a Site, you
just have the mix the two together in a custom container class:<br>
<br>
from zope.app.container.interfaces import IContainer<br>
from zope.app.component.interfaces import IPossibleSite<br>
<br>
class IMyFolder(IContainer, IPossibleSite):<br>
"""My Custom Container"""<br>
<br>
from zope.app.component.site import SiteManagerContainer<br>
from zope.app.container import btree<br>
<br>
class MyFolder(SiteManagerContainer, btree.BTreeContainer): <br>
zope.interface.implements(IMyFolder)<br>
<br>
Then the following should work:<br>
<br>
<br>
if 'AR' not in root['Application']:<br>
root['Application']['AR']=MyFolder()<br>
<div id="1epi" class="ArwC7c ckChnd">
sm = LocalSiteManager(root['Application']['AR'])<br>
root['Application']['AR'].setSiteManager(sm)<br>
transaction.commit()</div>
<br><br>
Randy<br><br><br><br><div class="gmail_quote">On Tue, Jul 8, 2008 at 11:10 AM, Tim Cook <<a href="mailto:timothywayne.cook@gmail.com">timothywayne.cook@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I am building a platform where I want to initialize the ZODB (that will<br>
be running under Zope) with three folders with sitemanagers.<br>
<br>
If I use Folders like this:<br>
<br>
if 'AR' not in root['Application']:<br>
root['Application']['AR']=folder.Folder()<br>
sm = LocalSiteManager(root['Application']['AR'])<br>
root['Application']['AR'].setSiteManager(sm)<br>
transaction.commit()<br>
<br>
it works great and I can then add initial objects to the folders.<br>
<br>
But, these folder sill potentially contain tens of thousands of objects<br>
so I really want to use BTree Folders. But when I do this:<br>
<br>
from zope.app.container.btree import BTreeContainer<br>
<br>
... <lots of other stuff><br>
<br>
if 'AR' not in root['Application']:<br>
root['Application']['AR']=BTreeContainer()<br>
sm = LocalSiteManager(root['Application']['AR'])<br>
root['Application']['AR'].setSiteManager(sm)<br>
transaction.commit()<br>
<br>
I get this:<br>
<br>
File<br>
"/home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/atbldr/atbldr.py", line 78, in ?<br>
root['Application']['AR'].setSiteManager(sm)<br>
AttributeError: 'BTreeContainer' object has no attribute<br>
'setSiteManager'<br>
<br>
So BtreeContainers don't have a siteManager.<br>
<br>
I would like to OOBTree but I have been unable to even discern the<br>
proper way to import it.<br>
<br>
Thanks.<br>
<br>
Tim<br>
<br>
<br>
<br>
<br>
<br>
--<br>
Timothy Cook, MSc<br>
Health Informatics Research & Development Services<br>
LinkedIn Profile:<a href="http://www.linkedin.com/in/timothywaynecook" target="_blank">http://www.linkedin.com/in/timothywaynecook</a><br>
Skype ID == timothy.cook<br>
**************************************************************<br>
*You may get my Public GPG key from popular keyservers or *<br>
*from this link <a href="http://timothywayne.cook.googlepages.com/home*" target="_blank">http://timothywayne.cook.googlepages.com/home*</a><br>
**************************************************************<br>
<br>_______________________________________________<br>
Zope3-users mailing list<br>
<a href="mailto:Zope3-users@zope.org">Zope3-users@zope.org</a><br>
<a href="http://mail.zope.org/mailman/listinfo/zope3-users" target="_blank">http://mail.zope.org/mailman/listinfo/zope3-users</a><br>
<br></blockquote></div><br>