[Zope] Z Classes Question

Jeff K.Hoffman jkhoffman@usa.net
10 May 99 10:53:23 EDT


Hello Zopesters,

I am working on a project using 1.11pre and Z Classes, and have run into
an interesting situation. First, let me tell you what I am trying to do.

I need to create a structure like this:

+ class
  - index_html
  - document_a
  - document_b
  + instance
    - document_a

Which is navigated to via http://mysite/instance. Why? Because the 'instance'
folder might be seven levels deep, and I never want the user to know about its
parents. Its context is always going to be the same
(/class1/class2/classN/instance). So, I thought, why not use a Z Class?

I made a 'class' Z Class which inherits from 'Object Manager' and defines
'index_html', 'document_a', and 'document_b'. So far so good. Now, what I want
to be able to do is to create an instance of my Z Class, 'instance' and place
a DTML Method inside it called 'document_a' which overrides the 'document_a'
member of the Z Class. In this way, I could navigate to my site via
http://mysite/instance/document_a and I would get the new, overloaded
'document_a', while navigating to http://mysite/instance/document_b would give
me the 'document_b' inherited from the Z Class.

This way, if I want a new instance of 'class', I can just drop it in place and
be done with it. If, however, my new instance requires 'document_b' be
slightly different than it was defined in 'class', I want to be able to easily
customize it via the Zope Management interface. Now, however, when I try to
drop a 'document_a' DTML Method in 'instance', I get a "Bad Request" error.
I'm thinking Zope is not allowing me to create 'document_a' because
'document_a' is already there as part of the class.

Is what I'm trying to do possible? If I didn't explain clearly enough, let me
know and I'll try to clarify. :)

Thanks,

--jkh

____________________________________________________________________
Get free e-mail and a permanent address at http://www.netaddress.com/?N=1