I am unshure on how BTrees works, but I suspect that they might be usefull in a project I am doing, so I thought I might ask here. I have an object which hase a dict as an attribute, in which I store other objects. I know this is a relative expensive way to do it as everytime an object is added to the dict the full object will be stored in the ZODB. As far as I understand, the BTree is like a dict. So do I understand it right that if I use a BTree as a attribute instead of a dict, it will only store the elements that are added/changed in the ZODB but otherwise act as a dict? I use integers as keys in the dict regards Max M
See http://www.zope.org/Members/ajung/BTrees/FrontPage -aj ----- Original Message ----- From: "Max M" <maxm@mxm.dk> To: <zope@zope.org> Sent: Thursday, May 02, 2002 16:52 Subject: [Zope] What use is BTrees ???
I am unshure on how BTrees works, but I suspect that they might be usefull in a project I am doing, so I thought I might ask here.
I have an object which hase a dict as an attribute, in which I store other objects. I know this is a relative expensive way to do it as everytime an object is added to the dict the full object will be stored in the ZODB.
As far as I understand, the BTree is like a dict.
So do I understand it right that if I use a BTree as a attribute instead of a dict, it will only store the elements that are added/changed in the ZODB but otherwise act as a dict?
I use integers as keys in the dict
regards Max M
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
how can a user, not the root folder manager, change their own password? - Bill
Max M wrote:
I am unshure on how BTrees works, but I suspect that they might be usefull in a project I am doing, so I thought I might ask here.
I have an object which hase a dict as an attribute, in which I store other objects. I know this is a relative expensive way to do it as everytime an object is added to the dict the full object will be stored in the ZODB.
As far as I understand, the BTree is like a dict.
So do I understand it right that if I use a BTree as a attribute instead of a dict, it will only store the elements that are added/changed in the ZODB but otherwise act as a dict?
I use integers as keys in the dict
Be sure, that you only use objects which can be compared to each other as keys. This means only use integers xor strings. Otherwise you can't access the objects anymore because the internal sorting gets confused. Unfortunately you don't get an exception if you try to insert different keys. thomas
why does the zope literature use the term acquisition and not inheritance? - Bill
Bill Kerr wrote:
why does the zope literature use the term acquisition and not inheritance?
Because it is completly different. acquisition is inheritance by containment. It is explained in the zope book, you can get from zope.org Please don't reply to email if you want to start a new thread. thomas
Bill Kerr wrote:
why does the zope literature use the term acquisition and not inheritance?
inheritance looks up names only *inside* the object. in zope, objects also are placed in space, have neigbours etc. aquisition looks up names also in the *neighbourhood* :-) ------------------------------------------------------------- Who's got only a hammer sees the world as a nail hans augustin (software developer) hans@beehive.de beehive elektronische medien GmbH http://www.beehive.de phone: +49 30 847-82 0 fax: +49 30 847-82 299
why can't I find the folder in which the Zope Button (that displays in the standard_html_footer) resides on my computer -- I can see the button but can't find it right click > View Source <img src="http://localhost:8080/p_/ZopeButton" etc. where is this p_ folder? -- Bill
Bill Kerr wrote:
<img src="http://localhost:8080/p_/ZopeButton" etc. where is this p_ folder?
UTSL... ...or alternatively, why do you care? ;-) And PLEASE stop starting new threads by replying to other messages, those of us with threading mail clients find it irritating! cheers, Chris
As I think you have found (or not found ;^), there is none. Zope is an object publishing system. The cute little folders and file icons you see are just an illusionary file-system-ish object hierarchy called OFS. So back to your question, p_ is not a folder at all. It is an object (technically its a class, but that is neither here nor there) which is an attribute of (IOW its attached to) the root folder, which is a folder (but a special one). The p_ attribute is defined in the Zope code as a container for Zope software to put things in that are built into the system. In technobabble terms, it is a special global "namespace" for the Zope software itself to store resources it uses. This namespace is separated (under the name p_) from the rest of the OFS so that you can define your own objects with just about any name, including "ZopeButton", without obscuring the ones in p_. So where does it come from? ZopeButton comes from a file in your Zope installation. The Zope software wraps this file in a special ImageFile object (which knows how to load image files as object) and then "mounts" it in p_. There are all kinds of other images in there as well, mostly all for use by the ZMI: icons, decorations, other powered by icons, etc. If you don't believe me, check out $Zope/lib/python/OFS/misc_.py -Casey On Thursday 02 May 2002 03:24 pm, Bill Kerr allegedly wrote:
why can't I find the folder in which the Zope Button (that displays in the standard_html_footer) resides on my computer -- I can see the button but can't find it right click > View Source
<img src="http://localhost:8080/p_/ZopeButton" etc. where is this p_ folder?
-- Bill
participants (7)
-
Andreas Jung -
Bill Kerr -
Casey Duncan -
Chris Withers -
hans -
Max M -
Thomas Guettler