Sorry for a slightly lengthy post - hope this is the right list.

I'm trying to extend Zwiki functionality, and have got quite a long way with
what I want - basically restricting some users to append-only in certain

However, although I can create the new properties, I'm not able to access
them in the edit method and I don't see what I should be doing. Other
properties seem to be accessible, but not my new ones (although they are
visible in the properties tab, and can be read Ok). I have tried appending
'self.' but this just comes up with an error telling me that they don't

The fragments below are all that I have added to the Zwiki product (see the
geoffg comments below for what I've done), but I've got some additions to
zwiki.zexp as well to provide forms input.

Thank you again for any and all help,
Geoff Gardiner

In ....

class ZWikiPage(DTMLDocument): #, CatalogAware):
    """A ZWikiPage is a DTML Document which knows how to render itself in
       various wiki styles, and provides some utility methods to support
    meta_type="ZWiki Page"
    icon     ="misc_/ZWiki/ZWikiPage_icon"

    # how would you append to the superclass' _properties here ??  #'
    _properties=({'id':'title', 'type': 'string', 'mode':'w'},
                 {'id':'page_type', 'type': 'string', 'mode': 'w'},
                 # ken's parenting code:
                 {'id':'parents', 'type': 'lines', 'mode': 'w'},
                 # ^^^ ken's parenting code
                 # VVV --- geoffg's managed_mode code --- Tested
                 {'id':'managed_mode', 'type': 'boolean', 'mode': 'w'},
                 {'id':'page_owner', 'type': 'string', 'mode': 'w'}
                 # ^^^ end geoffg's managed_mode code ---

        # 'manage_edit','manage_upload' already part of Change DTML Doc
permission - ok here ??
        ('Change ZWiki Pages',
        # VVV --- geoffg's managed_mode code --- Tested
        ('Manage ZWiki Pages',
        # ^^^ end geoffg's managed_mode code ---
        # add a View permission here ??
        # useful to define default roles ??

    # ken's parenting code:
    parents = None
    # ^^^ ken's parenting code
    # VVV --- geoffg's managed_mode code --- Tested
    managed_mode = 0
    page_owner = ''
    # ^^^ end geoffg's managed_mode code ---

    def edit(self, text=None, REQUEST=None, submit=None, type=None,
        """change a ZWikiPage's content and/or markup type
        self._validateProxy(REQUEST)    # correct ??


        if type is not None:
            self.page_type = type

        # VVV --- geoffg's managed_mode additions ---
        # Testing - logic Ok but can't access properties - why not?
        # edit form has hidden fields:
        #   'check_managed_mode' - look for existence of 'new_managed_mode'
        #   'check_page_owner' - look for existence of 'clear_page_owner'
        if REQUEST is not None:
          if REQUEST.has_key('check_managed_mode'):
            if REQUEST.has_key('new_managed_mode'):
          if managed_mode:
            if REQUEST.has_key('check_page_owner'):
              if REQUEST.has_key('clear_page_owner'):
        # ^^^ end geoffg's managed_mode additions

        if text is not None:

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to