You are not logged in Log in Join
You are here: Home » Members » 4AM Productions (Evan Simpson) » PythonMethodWiki » GeneralDescription

Log in
Name

Password

 
 

History for GeneralDescription

??changed:
-
General Description of Python Methods

  Python Methods are a subclass of SimpleItem.  Aside from the standard
  Security view, they have a Proxy role view, a "Try It" view which
  executes the method, and an editing view.

  Their important attributes are '_params' and '_body'.  Whenever one of
  these is changed, the Python Method passes its 'id', '_params',
  and '_body' are to CodeBlock subclass constructor GuardedBlock.  If
  GuardedBlock is able to compile the function::

    def {id}({_params}):
     {_block}

  then it stores a tuple containing the pieces of the compiled function
  as '_t'.  When the Python Method is called, it reconstructs the function
  from the stored tuple, providing it with a restricted set of builtin
  functions and access to the standard DTML functions through '_'.

  The Python Method exposes the function signature to ZPublisher. It binds
  'aq_parent.this()' if the first argument is 'self' and one positional
  argument is missing.