Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
CMFFormController.ControllerPythonScript.ControllerPythonScript Class Reference
Inheritance diagram for CMFFormController.ControllerPythonScript.ControllerPythonScript:
Inheritance graph
[legend]
Collaboration diagram for CMFFormController.ControllerPythonScript.ControllerPythonScript:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __call__
def manage_afterAdd
def manage_afterClone

Public Attributes

 validators
 actions

Static Public Attributes

string meta_type = 'Controller Python Script'
tuple manage_options
int is_validator = 0
tuple security = AccessControl.ClassSecurityInfo()

Private Member Functions

def _getState
def _notifyOfCopyTo

Detailed Description

Web-callable scripts written in a safe subset of Python.

The function may include standard python code, so long as it does
not attempt to use the "exec" statement or certain restricted builtins.

Definition at line 87 of file ControllerPythonScript.py.


Constructor & Destructor Documentation

Definition at line 134 of file ControllerPythonScript.py.

00134 
00135     def __init__(self, *args, **kwargs):
00136         self.validators = FormValidatorContainer()
00137         self.actions = FormActionContainer()
00138         return ControllerPythonScript.inheritedAttribute('__init__')(self, *args, **kwargs)
00139 


Member Function Documentation

Definition at line 140 of file ControllerPythonScript.py.

00140 
00141     def __call__(self, *args, **kwargs):
00142         REQUEST = self.REQUEST
00143         controller = getToolByName(self, 'portal_form_controller')
00144         controller_state = controller.getState(self, is_validator=0)
00145         controller_state = self.getButton(controller_state, REQUEST)
00146         validators = self.getValidators(controller_state, REQUEST).getValidators()
00147 
00148         # put all arguments into a dict
00149         c = self.func_code
00150         param_names = c.co_varnames[:c.co_argcount]
00151         argdict = {}
00152         index = 0
00153         # grab the names for positional arguments out of the function code
00154         for a in args:
00155             argdict[param_names[index]] = a
00156             index += 1
00157         argdict.update(kwargs)
00158 
00159         controller_state = controller.validate(controller_state, REQUEST, validators, argdict)
00160 
00161         if controller_state.getStatus() == 'success':
00162             result = ControllerPythonScript.inheritedAttribute('__call__')(self, *args, **kwargs)
00163             if getattr(result, '__class__', None) == ControllerState and not result._isValidating():
00164                 return self.getNext(result, self.REQUEST)
00165             return result
00166         else:
00167             return self.getNext(controller_state, self.REQUEST)
00168 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 169 of file ControllerPythonScript.py.

00169 
00170     def _getState(self):
00171         return getToolByName(self, 'portal_form_controller').getState(self, is_validator=0)
00172 

Here is the call graph for this function:

def CMFFormController.ControllerPythonScript.ControllerPythonScript._notifyOfCopyTo (   self,
  container,
  op = 0 
) [private]

Definition at line 173 of file ControllerPythonScript.py.

00173 
00174     def _notifyOfCopyTo(self, container, op=0):
00175         # BaseClass.inheritedAttribute('notifyOfCopyTo')(self, container, op)
00176         self._base_notifyOfCopyTo(container, op)

Here is the call graph for this function:

Definition at line 177 of file ControllerPythonScript.py.

00177 
00178     def manage_afterAdd(self, object, container):
00179         BaseClass.inheritedAttribute('manage_afterAdd')(self, object, container)
00180         self._base_manage_afterAdd(object, container)

Here is the call graph for this function:

Definition at line 181 of file ControllerPythonScript.py.

00181 
00182     def manage_afterClone(self, object):
00183         BaseClass.inheritedAttribute('manage_afterClone')(self, object)
00184         self._base_manage_afterClone(object)

Here is the call graph for this function:


Member Data Documentation

Definition at line 136 of file ControllerPythonScript.py.

Definition at line 116 of file ControllerPythonScript.py.

Initial value:
(
        {'label':'Edit',
         'action':'ZPythonScriptHTML_editForm',
         'help': ('PythonScripts', 'PythonScript_edit.stx')},
        )

Definition at line 98 of file ControllerPythonScript.py.

Definition at line 94 of file ControllerPythonScript.py.

tuple CMFFormController.ControllerPythonScript.ControllerPythonScript.security = AccessControl.ClassSecurityInfo() [static]

Definition at line 118 of file ControllerPythonScript.py.

Definition at line 135 of file ControllerPythonScript.py.


The documentation for this class was generated from the following file: