[Zope] ZClass, acquisition, dtml confusion

2000-09-08 Thread Jon Franz

Hello,
Previously I made a DTML method that when used within a 
DTML Document would modify properties on that document.  
Having this floating around in root made it visible to the 
whole site, but seemed 'unclean'.  So, I attempted to make 
the DTML method into a ZClass, and making the index_html 
method in the ZClass contain the exact same DTML as the 
method... But it doesn't work.  So, I tried again - this 
time with as simple a method as possible, a very basic 
counter.  The DTML method I made in root increments and 
displays the 'z_count' property on the page that calls it, 
and creates the property if it doesn't exist, so using it 
is as simple as:

dtml-var mycount

However, I place the DTML into a new class, and then make 
a new instance of the class, and it wont work as above.  
I now have to do this:

dtml-with MyZCCount
dtml-var MyZCCount
/dtml-with

And, instead of modifying the property of the calling document, 
it modifies the parent folder's properties.  Below is the DTML, 
can someone please explain what I need to do to get this to 
work on the calling DTML document instead?  If I can't get 
this simple counter to work I'm going to go mad, since changing 
properties is something I need to be able to do from many of my 
planned ZClasses... Thanks in advance!

dtml-if "hasProperty('z_count')"
  dtml-var "'%06d' % (z_count + 1)"
  dtml-call "REQUEST.set('z_count', z_count + 1)"
  dtml-call "manage_changeProperties(REQUEST)"
dtml-else
  dtml-call "manage_addProperty('z_count', 1, 'int' )"
  01
dtml-if

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] ZClass, acquisition, dtml confusion

2000-09-08 Thread Tim Cook

Jon Franz wrote:
 
 dtml-var mycount
 
 However, I place the DTML into a new class, and then make
 a new instance of the class, and it wont work as above.
 I now have to do this:
 
 dtml-with MyZCCount
 dtml-var MyZCCount
 /dtml-with
 
 And, instead of modifying the property of the calling document,
 it modifies the parent folder's properties.  Below is the DTML,
 can someone please explain what I need to do to get this to

I hope someone can answer this. I am having a similar problem. I
posted yesterday but haven't received an answer yet either. 
There is a significant difference in the way properties get
changed in a ZClass depending on it being a folderish property or
a document property.  
Trouble is I have figured out those differences. g

Can someone shed some light on this?

-- Tim Cook --
FreePM Project Coordinator http://www.freepm.org
OS Health Care Alliance Supporter http://www.oshca.org

___
Zope maillist  -  [EMAIL PROTECTED]
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 )