Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
CMFDefault.formlib.form.ContentEditFormBase Class Reference
Inheritance diagram for CMFDefault.formlib.form.ContentEditFormBase:
Inheritance graph
[legend]
Collaboration diagram for CMFDefault.formlib.form.ContentEditFormBase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUpWidgets
def label
def handle_validate
def handle_change_success
def handle_change_and_view_success
def handle_failure

Public Attributes

 adapters
 widgets
 status
 context
 request

Static Public Attributes

tuple actions
string description = u''
tuple template = ViewPageTemplateFile('editform.pt')

Private Member Functions

def _handle_success

Detailed Description

Definition at line 95 of file form.py.


Member Function Documentation

def CMFDefault.formlib.form.ContentEditFormBase._handle_success (   self,
  action,
  data 
) [private]

Definition at line 130 of file form.py.

00130 
00131     def _handle_success(self, action, data):
00132         # normalize set and datetime
00133         for k, v in data.iteritems():
00134             if isinstance(v, Set):
00135                 data[k] = set(v)
00136             elif isinstance(v, datetime) and v.tzname() is None:
00137                 data[k] = parseDatetimetz(str(v))
00138         changed = form.applyChanges(self.context, self.form_fields, data,
00139                                     self.adapters)
00140         if changed:
00141             self.context.reindexObject()
00142             obj_type = translate(self.context.Type(), self.context)
00143             self.status = _(u'${obj_type} changed.',
00144                             mapping={'obj_type': obj_type})
00145         else:
00146             self.status = _(u'Nothing to change.')
00147         return changed

Here is the caller graph for this function:

Definition at line 152 of file form.py.

00152 
00153     def handle_change_and_view_success(self, action, data):
00154         self._handle_success(action, data)
00155         return self._setRedirect('portal_types', 'object/view')
00156 

Here is the call graph for this function:

Definition at line 148 of file form.py.

00148 
00149     def handle_change_success(self, action, data):
00150         self._handle_success(action, data)
00151         return self._setRedirect('portal_types', 'object/edit')

Here is the call graph for this function:

def CMFDefault.formlib.form.EditFormBase.handle_failure (   self,
  action,
  data,
  errors 
) [inherited]

Definition at line 89 of file form.py.

00089 
00090     def handle_failure(self, action, data, errors):
00091         if self.status:
00092             message = translate(self.status, self.context)
00093             self.request.other['portal_status_message'] = message
00094 

def CMFDefault.formlib.form.ContentEditFormBase.handle_validate (   self,
  action,
  data 
)

Definition at line 125 of file form.py.

00125 
00126     def handle_validate(self, action, data):
00127         if self.context.wl_isLocked():
00128             return (_(u'This resource is locked via webDAV.'),)
00129         return None

Definition at line 121 of file form.py.

00121 
00122     def label(self):
00123         obj_type = translate(self.context.Type(), self.context)
00124         return _(u'Edit ${obj_type}', mapping={'obj_type': obj_type})

Here is the caller graph for this function:

def CMFDefault.formlib.form.ContentEditFormBase.setUpWidgets (   self,
  ignore_request = False 
)

Definition at line 113 of file form.py.

00113 
00114     def setUpWidgets(self, ignore_request=False):
00115         self.adapters = {}
00116         self.widgets = form.setUpEditWidgets(
00117             self.form_fields, self.prefix, self.context, self.request,
00118             adapters=self.adapters, ignore_request=ignore_request
00119             )


Member Data Documentation

Initial value:
form.Actions(
        form.Action(
            name='change',
            label=_(u'Change'),
            validator='handle_validate',
            success='handle_change_success',
            failure='handle_failure'),
        form.Action(
            name='change_and_view',
            label=_(u'Change and View'),
            validator='handle_validate',
            success='handle_change_and_view_success',
            failure='handle_failure'))

Definition at line 97 of file form.py.

Definition at line 114 of file form.py.

Definition at line 61 of file form.py.

Definition at line 111 of file form.py.

Definition at line 62 of file form.py.

Definition at line 142 of file form.py.

tuple CMFDefault.formlib.form.EditFormBase.template = ViewPageTemplateFile('editform.pt') [static, inherited]

Definition at line 58 of file form.py.

Definition at line 115 of file form.py.


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