Editing ZClasses - Hole in Documentation
Okay, I just want to point out a "hole" in the documentation that is consistent among the various "HOWTO's" and other documentation, such as mukhsein's "Build a searchable Job Board." They all provide a way to create and add objects, but don't go that last mile and provide any guidance on who to _edit_ the properties in a ZClass. The problem with ZClasses is that the properties have to be accessed through the propertysheets. That creates an extra hrutle for the developer in creating a _complete_ system (which, of course, includes the ability to edit what was created). Some of us have products we would like to roll out that require that users (including managers, owners, and yes, sometimes even anonymous (if your organization can handle that)) to edit the ZClass instance once it has been instantiated. I'm still hunting for either documentation or an example that has this capability. In a few instances, I have seen people say it is "trivial." It may be, once you find out how. Unfortunately, there is still some smoke and mirrors here. The solution isn't obvious to the casual developer. If someone can prove me wrong, I would be thrilled to know about it. Best, Ron
On Thursday 15 November 2001 06:55 am, Ronald L. Chichester allegedly wrote: [snip]
Some of us have products we would like to roll out that require that users (including managers, owners, and yes, sometimes even anonymous (if your organization can handle that)) to edit the ZClass instance once it has been instantiated. I'm still hunting for either documentation or an example that has this capability. In a few instances, I have seen people say it is "trivial." It may be, once you find out how. Unfortunately, there is still some smoke and mirrors here. The solution isn't obvious to the casual developer.
If someone can prove me wrong, I would be thrilled to know about it.
Best,
Ron
You dare to suggest that there is a capability of Zope that is undocumented? I find the mere suggestion of this utterly infathomable! Seriously, tho, the API of Zope and especially ZClasses is pretty opaque in places, unless you like hunting through the source code, which in the case of ZClasses doesn't help much without Jim F. looking over your shoulder... 8^) Actually there is an example of how to do this right under your nose. The default constructor method of the ZClass has the important call syntax in a comment as an example. Something like: <dtml-call expr="propertysheets.Basic.manage_editProperties(REQUEST)"> Now, manage_editProperties is fine so long as you want to change all of the properties at once, but not if you only need to change one or two. For that, use manage_changeProperties. This call would work in response to a form (either from Python or DTML): propertysheets.my_property_sheet.manage_changeProperties(REQUEST) just make sure the ZClass instance is at the top of the namespace stack, which is easily accomplished using the URL as in: http://zope/path/to/instance/editMethod <plug type="shameless"> You can find a complete example of a ZClass based app in the newly-published "Book of Zope" which is sadly only available in dead-tree form. Although you can download the ZCatalog chapter at www.nostarch.com. </plug> hth, /---------------------------------------------------\ Casey Duncan, Sr. Web Developer National Legal Aid and Defender Association c.duncan@nlada.org \---------------------------------------------------/
On Thursday 15 November 2001 07:55 pm, Ronald L. Chichester wrote:
Some of us have products we would like to roll out that require that users (including managers, owners, and yes, sometimes even anonymous (if your organization can handle that)) to edit the ZClass instance once it has been instantiated. I'm still hunting for either documentation or an example that has this capability. In a few instances, I have seen people say it is "trivial." It may be, once you find out how.
<plug> have you tried http://www.zope.org/Members/kedai/BuildSimpleZClass ? it does contain steps in creating dfault views (management and user view) it may be be written haphazardly (:))... but comments are welcome </plug>
participants (3)
-
bak -
Casey Duncan -
Ronald L. Chichester