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>
&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;My Custom Container&quot;&quot;&quot;<br>
<br>

from zope.app.component.site import SiteManagerContainer<br>

from zope.app.container import btree<br>

<br>

class MyFolder(SiteManagerContainer, btree.BTreeContainer): <br>
&nbsp;&nbsp;&nbsp; zope.interface.implements(IMyFolder)<br>

<br>

Then the following should work:<br>

<br>

<br>

if &#39;AR&#39; not in root[&#39;Application&#39;]:<br>


 &nbsp; &nbsp;root[&#39;Application&#39;][&#39;AR&#39;]=MyFolder()<br>

<div id="1epi" class="ArwC7c ckChnd">
 &nbsp; &nbsp;sm = LocalSiteManager(root[&#39;Application&#39;][&#39;AR&#39;])<br>
 &nbsp; &nbsp;root[&#39;Application&#39;][&#39;AR&#39;].setSiteManager(sm)<br>
 &nbsp; &nbsp;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 &lt;<a href="mailto:timothywayne.cook@gmail.com">timothywayne.cook@gmail.com</a>&gt; 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 &#39;AR&#39; not in root[&#39;Application&#39;]:<br>
 &nbsp; &nbsp;root[&#39;Application&#39;][&#39;AR&#39;]=folder.Folder()<br>
 &nbsp; &nbsp;sm = LocalSiteManager(root[&#39;Application&#39;][&#39;AR&#39;])<br>
 &nbsp; &nbsp;root[&#39;Application&#39;][&#39;AR&#39;].setSiteManager(sm)<br>
 &nbsp; &nbsp;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. &nbsp;But when I do this:<br>
<br>
from zope.app.container.btree import BTreeContainer<br>
<br>
... &lt;lots of other stuff&gt;<br>
<br>
if &#39;AR&#39; not in root[&#39;Application&#39;]:<br>
 &nbsp; &nbsp;root[&#39;Application&#39;][&#39;AR&#39;]=BTreeContainer()<br>
 &nbsp; &nbsp;sm = LocalSiteManager(root[&#39;Application&#39;][&#39;AR&#39;])<br>
 &nbsp; &nbsp;root[&#39;Application&#39;][&#39;AR&#39;].setSiteManager(sm)<br>
 &nbsp; &nbsp;transaction.commit()<br>
<br>
I get this:<br>
<br>
 &nbsp;File<br>
&quot;/home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/atbldr/atbldr.py&quot;, line 78, in ?<br>
 &nbsp; &nbsp;root[&#39;Application&#39;][&#39;AR&#39;].setSiteManager(sm)<br>
AttributeError: &#39;BTreeContainer&#39; object has no attribute<br>
&#39;setSiteManager&#39;<br>
<br>
So BtreeContainers don&#39;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 &amp; 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 &nbsp;popular keyservers or &nbsp; *<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>