[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/browser/stateful
- contentworkflow.py:1.3 definition.py:1.2 instance.py:1.3
Garrett Smith
garrett at mojave-corp.com
Fri Mar 5 23:17:27 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/workflow/browser/stateful
In directory cvs.zope.org:/tmp/cvs-serv15646/src/zope/app/workflow/browser/stateful
Modified Files:
contentworkflow.py definition.py instance.py
Log Message:
Merged changes from garrett-widgets2-branch:
- Changed the way widgets are looked up to use interfaces instead of
names.
- Refactor of zope/app/form/utility.py -- see
http://dev.zope.org/Zope3/WidgetsAndMultiwayAdapters
for details.
- Moved configuration of vocab widgets to its own zcml file
(zope/app/browser/form/vocabularywidget.zcml).
- Removed 'propertyNames' and 'getValue' from widgets. This is replaced
by accessing the widget attributes directly.
- Deleted depreated methods from widget interface: haveData and getData.
=== Zope3/src/zope/app/workflow/browser/stateful/contentworkflow.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/workflow/browser/stateful/contentworkflow.py:1.2 Fri Mar 5 10:57:05 2004
+++ Zope3/src/zope/app/workflow/browser/stateful/contentworkflow.py Fri Mar 5 23:17:26 2004
@@ -21,6 +21,7 @@
from zope.app.i18n import ZopeMessageIDFactory as _
from zope.app.form.utility import setUpWidgets
from zope.app.services.servicenames import Workflows
+from zope.app.interfaces.form import IInputWidget
from zope.component import getService
from zope.interface import Interface
from zope.publisher.browser import BrowserView
@@ -57,7 +58,7 @@
def __init__(self, *args):
super(ManageContentProcessRegistry, self).__init__(*args)
- setUpWidgets(self, IContentProcessMapping)
+ setUpWidgets(self, IContentProcessMapping, IInputWidget)
self.process_based = int(self.request.get('process_based', '1'))
def getProcessInterfacesMapping(self):
=== Zope3/src/zope/app/workflow/browser/stateful/definition.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/workflow/browser/stateful/definition.py:1.1 Fri Feb 27 11:50:38 2004
+++ Zope3/src/zope/app/workflow/browser/stateful/definition.py Fri Mar 5 23:17:26 2004
@@ -22,6 +22,7 @@
from zope.app.browser.container.adding import Adding
from zope.app.browser.form.submit import Update
from zope.app.browser.form.editview import EditView
+from zope.app.interfaces.form import IInputWidget
from zope.app.workflow.stateful.definition import State, Transition
from zope.schema import getFields
@@ -82,7 +83,8 @@
title=u"Accessor Permission",
default=CheckerPublic,
required=False)
- setUpWidget(self, name+'_get_perm', permField, value=get_perm)
+ setUpWidget(self, name + '_get_perm', permField, IInputWidget,
+ value=get_perm)
# Create the Mutator Permission Widget for this field
permField = PermissionField(
@@ -90,7 +92,8 @@
title=u"Mutator Permission",
default=CheckerPublic,
required=False)
- setUpWidget(self, name+'_set_perm', permField, value=set_perm)
+ setUpWidget(self, name+'_set_perm', permField, IInputWidget,
+ value=set_perm)
def update(self):
status = ''
=== Zope3/src/zope/app/workflow/browser/stateful/instance.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/workflow/browser/stateful/instance.py:1.2 Mon Mar 1 10:02:54 2004
+++ Zope3/src/zope/app/workflow/browser/stateful/instance.py Fri Mar 5 23:17:26 2004
@@ -23,6 +23,7 @@
from zope.app.browser.form.submit import Update
from zope.app.form.utility import setUpWidget, applyWidgetsChanges
+from zope.app.interfaces.form import IInputWidget
from zope.app.i18n import ZopeMessageIDFactory as _
from zope.app.dublincore.interfaces import IZopeDublinCore
from zope.app.services.servicenames import Workflows
@@ -46,7 +47,7 @@
for name, field in getFields(schema).items():
# setUpWidget() does not mutate the field, so it is ok.
field = trustedRemoveSecurityProxy(field)
- setUpWidget(self, name, field,
+ setUpWidget(self, name, field, IInputWidget,
value=getattr(workflow.data, name))
def _extractContentInfo(self, item):
@@ -141,9 +142,8 @@
if Update in self.request and workflow.data is not None:
schema = trustedRemoveSecurityProxy(workflow.data.getSchema())
- changed = applyWidgetsChanges(
- self, workflow.data, schema, names=getFields(schema).keys(),
- exclude_readonly=True)
+ changed = applyWidgetsChanges(self, schema, target=workflow.data,
+ names=getFields(schema).keys())
if changed:
status = _('Updated Workflow Data.')
More information about the Zope3-Checkins
mailing list