work in progress: fields for state change dialog: concept, TODO markers, basic definition
This commit is contained in:
parent
fa9092b137
commit
e183dd77c6
1 changed files with 6 additions and 3 deletions
|
@ -134,10 +134,11 @@ class ChangeStateForm(ObjectForm, ChangeStateBase):
|
|||
|
||||
@Lazy
|
||||
def schema(self):
|
||||
# TODO: use field information specified in transition
|
||||
# TODO: use field information specified in transition.schema
|
||||
# schema = self.transition.schema
|
||||
commentsField = Field('comments', _(u'label_transition_comments'),
|
||||
'textarea',
|
||||
description=_(u'desc_transition_comments'))
|
||||
'textarea', description=_(u'desc_transition_comments'),
|
||||
storeData=False)
|
||||
fields = [commentsField]
|
||||
return Schema(name='change_state', request=self.request,
|
||||
manager=self, *fields)
|
||||
|
@ -146,6 +147,8 @@ class ChangeStateForm(ObjectForm, ChangeStateBase):
|
|||
class ChangeState(EditObject, ChangeStateBase):
|
||||
|
||||
def update(self):
|
||||
# TODO: get field information from self.schema,
|
||||
# store data in context if field.storeData is set, always track
|
||||
comments = self.request.form.get('comments') or u''
|
||||
self.stateful.doTransition(self.action)
|
||||
notify(ObjectModifiedEvent(self.view.virtualTargetObject,
|
||||
|
|
Loading…
Add table
Reference in a new issue