Changeset 6915 for main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py
- Timestamp:
- 20 Oct 2011, 17:14:37 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py
r6907 r6915 2 2 ## interfaces.py 3 3 import os 4 from datetime import datetime 4 5 from hurry.workflow.interfaces import IWorkflow, IWorkflowInfo 5 6 from zc.sourcefactory.basic import BasicSourceFactory … … 13 14 os.path.dirname(__file__), 'frontpage.rst'), 'rb').read() 14 15 16 def SimpleWAeUPVocabulary(*terms): 17 """A well-buildt vocabulary provides terms with a value, token and 18 title for each term 19 """ 20 return SimpleVocabulary([ 21 SimpleTerm(value, value, title) for title, value in terms]) 22 23 def year_range(): 24 curr_year = datetime.now().year 25 return range(curr_year - 2, curr_year + 5) 26 27 def academic_sessions(): 28 curr_year = datetime.now().year 29 year_range = range(curr_year - 10, curr_year + 2) 30 return [('%s/%s' % (year,year+1), year) for year in year_range] 31 32 academic_sessions_vocab = SimpleWAeUPVocabulary(*academic_sessions()) 33 15 34 class FatalCSVError(Exception): 16 35 """Some row could not be processed. … … 32 51 def __str__(self): 33 52 return '%r' % self.msg 34 35 def SimpleWAeUPVocabulary(*terms):36 """A well-buildt vocabulary provides terms with a value, token and37 title for each term38 """39 return SimpleVocabulary([40 SimpleTerm(value, value, title) for title, value in terms])41 53 42 54 class RoleSource(BasicSourceFactory): … … 216 228 217 229 class ISessionConfiguration(IWAeUPObject): 218 """A container for session configuration objects. 219 """ 230 """A session configuration object. 231 """ 232 233 academic_session = schema.Choice( 234 title = u'Academic Session', 235 source = academic_sessions_vocab, 236 default = None, 237 required = True, 238 readonly = True, 239 ) 240 241 fee_1 = schema.Int( 242 title = u'School Fee', 243 default = 0, 244 ) 220 245 221 246 class IDataCenter(IWAeUPObject):
Note: See TracChangeset for help on using the changeset viewer.