Changeset 5949 for main/waeup.sirp/trunk/src/waeup/sirp/university
- Timestamp:
- 15 Apr 2011, 06:03:44 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/university
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/university/certificate.py
r5947 r5949 30 30 self.application_category = application_category 31 31 # Initialize workflow state... 32 self.setReviewState('unchecked')32 # self.setReviewState('unchecked') 33 33 34 def check(self):35 """Set Review State to ``checked``.36 """37 self.setReviewState(state='checked')34 #def check(self): 35 # """Set Review State to ``checked``. 36 # """ 37 # self.setReviewState(state='checked') 38 38 39 def getReviewState(self):40 return IWorkflowState(self).getState()39 #def getReviewState(self): 40 # return IWorkflowState(self).getState() 41 41 42 def setReviewState(self, state=None):43 """Try to set new state.42 #def setReviewState(self, state=None): 43 # """Try to set new state. 44 44 45 Instead of simply setting a value, we fire a transition of a46 workflow. This might fail if, for instance, the required state47 is not part of the workflow or unreachable from current state.48 """49 if state == self.getReviewState():50 # Accept staying in the same state, even if workflow does51 # not allow this.52 return53 info = IWorkflowInfo(self)54 info.fireTransitionToward(state)55 return45 # Instead of simply setting a value, we fire a transition of a 46 # workflow. This might fail if, for instance, the required state 47 # is not part of the workflow or unreachable from current state. 48 # """ 49 # if state == self.getReviewState(): 50 # # Accept staying in the same state, even if workflow does 51 # # not allow this. 52 # return 53 # info = IWorkflowInfo(self) 54 # info.fireTransitionToward(state) 55 # return 56 56 57 review_state = property(getReviewState, setReviewState)57 #review_state = property(getReviewState, setReviewState) 58 58 59 59 def addCourseRef(self, course, level=100, core_or_elective=True): -
main/waeup.sirp/trunk/src/waeup/sirp/university/certificate.txt
r5947 r5949 58 58 u'NA' 59 59 60 .. attribute:: review_state61 62 The review state can have one of the ``checking`` states defined63 in the WAeUP workflow. These are at least the states ``checked``64 and ``unchecked``. After a certificate is created, the review65 state is ``unchecked``:66 67 >>> mycertificate.review_state68 'unchecked'69 70 .. seealso::71 :meth:`Certificate.check` -- mark a certificate as ``checked``72 73 60 74 61 .. attribute:: study_mode … … 108 95 109 96 .. XXX: This is not a proper description 110 111 112 .. method:: check()113 114 Mark a certificate instance's review state as ``checked``:115 116 >>> mycertificate.review_state117 'unchecked'118 119 >>> mycertificate.check()120 >>> mycertificate.review_state121 'checked'122 123 We cannot uncheck a certificate:124 125 >>> mycertificate.review_state = 'unchecked'126 Traceback (most recent call last):127 ...128 NoTransitionAvailableError129 130 The only states accepted at all are ``checked`` and131 ``unchecked``. If we want to set something else this won't work:132 133 >>> mycertificate.review_state = 'nonsense'134 Traceback (most recent call last):135 ...136 NoTransitionAvailableError137 138 97 139 98 .. method:: addCourseRef(course[, level=100,[ core_or_elective=True]]) -
main/waeup.sirp/trunk/src/waeup/sirp/university/interfaces.py
r5948 r5949 144 144 ) 145 145 146 review_state = schema.Choice(147 title = u'Review State',148 default = 'unchecked',149 values = ['unchecked', 'checked']150 )146 #review_state = schema.Choice( 147 # title = u'Review State', 148 # default = 'unchecked', 149 # values = ['unchecked', 'checked'] 150 # ) 151 151 152 152 title = schema.TextLine( … … 171 171 172 172 application_category = schema.TextLine( 173 title = u' aApplication Category',173 title = u'Application Category', 174 174 required = False, 175 175 )
Note: See TracChangeset for help on using the changeset viewer.