[Zope3-Users] Q: Custom containers, non-persistent items
Paul Everitt
paul at zope-europe.org
Wed Nov 10 02:47:27 EST 2004
First, this is very much a newbie question, so apologies in advance.
Yesterday I sent this note to zope3-dev before this list was created,
but this question clearly isn't meant for zope3-dev.
I'm trying to fill in the example in
zope/app/container/sample.py->SampleContainer. My ultimate goal is to
traverse a custom container, grab the next item, and look it up in
Berkeley DB XML. For example, dbxmlfolder/37 would look up an item
"37" in the DBXML and return some HTML that I generate.
sample.py->SampleContainer has a method _newContainerData where you
supply a mapping. I have wired this up, returning an empty dictionary,
and I can browse to dbxmlfolder. I can't, though, browse to any items
in the dictionary.
(Yesterday I had a complex traceback, but this was due to something
dumb in the ZCML I wired in.)
I've tried a few things, but I'm clearly flailing. Thus some questions:
1) Are the keys for this dictionary simple strings?
2) Are the values...errr, special in any way? For example, can I just
put instances of Python classes that aren't wired into the CA (so I can
skip debugging ZCML, interfaces, factories, views, etc. until I get
past this traceback)?
Stated differently, what is the least amount of work to get
_newContainerData to return non-empty sample information when
traversing to an item? I'm looking for something like Bobo's
publishable mappings.
Thanks for any insight!
--Paul
More information about the Zope3-users
mailing list