Changeset 4311 for waeup/branches


Ignore:
Timestamp:
18 Jun 2009, 11:26:44 (15 years ago)
Author:
uli
Message:

Make certificates stateful (i.e. participate in workflows).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/university/certificate.py

    r4292 r4311  
    2323        self.m_prefix = m_prefix
    2424        self.max_pass = max_pass
     25        # Initialize workflow state...
     26        self.setReviewState('init')
     27
     28    def check(self):
     29        self.setReviewState('check')
     30
     31    def getReviewState(self):
     32        from hurry.workflow.interfaces import IWorkflowState
     33        return IWorkflowState(self).getState()
     34
     35    def setReviewState(self, transition_id='check'):
     36        from hurry.workflow.interfaces import IWorkflowInfo
     37        info = IWorkflowInfo(self)
     38        info.fireTransition(transition_id)
     39        return
     40
     41    review_state = property(getReviewState, setReviewState)
     42
    2543
    2644class CertificateFactory(grok.GlobalUtility):
Note: See TracChangeset for help on using the changeset viewer.