[Zope-dev] Acquisition and Folders in ZClasses

Kevin Dangoor kid@kendermedia.com
Thu, 22 Jul 1999 20:56:53 -0400


Maybe this belongs on zope-dev... I'm trying to decide if I should
change how I do these things, or if what I'm describing below is how
things *should* work... Any comments?

Thanks,
Kevin

---

Hi,

I'm having trouble with acquisition in a case where I have a ZClass with

a Folder inside the Methods tab of the class.

Here's what I've got:

KMArticleStore (ZClass)
 - article_list (DTML Method)
 - html (Folder)
   * index_html (DTML Method)
   * list_item (DTML Method)

Zope Root
 - index_html (DTML Method)
 - art (KMArticleStore)

My index_html looks like this:
<dtml-with art>
 <dtml-with html>
  <dtml-var "index_html(category='top')">
 </dtml-with>
</dtml-with>

The index_html in the html Folder looks like:
<dtml-var standard_html_header>
<dtml-var article_list>
<dtml-var standard_html_footer>

When I access the top level index_html, I get a KeyError in the other
index_html for 'standard_html_header' which exists in the Zope root. If
I remove that reference (replacing
it with just <html><body>), it can't find article_list... which exists
in the KMArticleStore.

*Should* this work? I was figuring that a Folder within a ZClass should
work like a normal Folder.

Also, should Zope allow us to override a ZClass class method at the
instance level? (I just get an error stating that the id already
exists).

I'm running 2.0a4 (on Windows). If this behavior is not reproduceable,
then I'll check out the beta when it comes out and see how it works...

Thanks!
Kevin