[Zope] declarePublic function

Milos Prudek prudek at bvx.cz
Tue Jan 27 10:31:31 EST 2009


> JMZPTMacros. Most likely, the author meant to protect the method right
> below that line.
>
> To illustrate, the code probably looks something like:
>
>   security.declarePublic()
>   def someMethod(self, REQUEST):

Actually, it does not look like that. It is not followed by method definition. 
Here is all the context:

class JMZPTMacros:
  #All the ZPT Objects will be loaded as attributes of my
  #JMZPTMacros class

  security=ClassSecurityInfo()
  security.declarePublic()

  #Loads my generic manage_add form macros
  security.declarePublic('generic_add')
  generic_add=PageTemplateFile('zpt/generic_add',globals())
  generic_add._owner=None

  #Loads my generic manage_edit form macros
  security.declarePublic('generic_edit')
  generic_edit=PageTemplateFile('zpt/generic_edit',globals())
  generic_edit._owner=None

  #Loads my generic manage_view form macros
  security.declarePublic('generic_view')
  generic_view=PageTemplateFile('zpt/generic_view',globals())
  generic_view._owner=None

  #Loads my generic macros
  security.declarePublic('generic')
  generic=PageTemplateFile('zpt/generic',globals())
  generic._owner=None


So, since there are many correct calls of declarePublic(), what does the 
incorrect (paremeter-less) call near the top of the class do?

-- 
Milos Prudek


More information about the Zope mailing list