Changeset 5988 for main/waeup.sirp/trunk/src/waeup/sirp/university
- Timestamp:
- 27 Apr 2011, 07:43:49 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/university
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/university/department.py
r5953 r5988 6 6 from zope.interface import implementedBy 7 7 from waeup.sirp.university.interfaces import IDepartment, IDepartmentAdd 8 from waeup.sirp.university.vocabularies import inst_types 8 9 9 10 class Department(grok.Container): … … 40 41 return None 41 42 43 def longtitle(self): 44 return "%s %s (%s)" % (inst_types.getTerm(self.title_prefix).title, 45 self.title, 46 self.code) 47 42 48 43 49 class DepartmentFactory(grok.GlobalUtility): -
main/waeup.sirp/trunk/src/waeup/sirp/university/faculty.py
r5953 r5988 7 7 from waeup.sirp.university.interfaces import ( 8 8 IFaculty, IFacultyAdd, IDepartment) 9 from waeup.sirp.university.vocabularies import inst_types 9 10 10 11 class Faculty(grok.Container): … … 36 37 del self[key] 37 38 38 #def getName(self, key): 39 # """Get complete department name. 40 # """ 41 # if key in self.keys(): 42 # dept = self[key] 43 # prefix = dept.title_prefix 44 # prefix = prefix[0].upper() + prefix[1:] 45 # return '%s of %s' % (prefix, dept.title) 46 39 def longtitle(self): 40 return "%s %s (%s)" % (inst_types.getTerm(self.title_prefix).title, 41 self.title, 42 self.code) 47 43 48 44 class FacultyFactory(grok.GlobalUtility): -
main/waeup.sirp/trunk/src/waeup/sirp/university/facultycontainer.py
r5915 r5988 22 22 del self[key] 23 23 24 #def getName(self, key):25 # if key in self.keys():26 # fac = self[key]27 # prefix = fac.title_prefix28 # prefix = prefix[0].upper() + prefix[1:]29 # return '%s of %s' % (prefix, fac.title)30 31 24 class FacultyContainerFactory(grok.GlobalUtility): 32 25 """A factory for faculty containers. -
main/waeup.sirp/trunk/src/waeup/sirp/university/interfaces.py
r5986 r5988 9 9 application_category, 10 10 study_mode, 11 inst_types, 11 12 CourseSource) 12 13 … … 28 29 ) 29 30 30 title_prefix = schema. TextLine(31 title_prefix = schema.Choice( 31 32 title = u'Title prefix', 32 33 default = u'faculty', 33 required = True, 34 ) 34 vocabulary = inst_types, 35 required = True, 36 ) 37 38 def longtitle(): 39 """ 40 Returns the long title of a faculty. 41 """ 35 42 36 43 class IFacultyAdd(IFaculty): … … 72 79 ) 73 80 74 title_prefix = schema. TextLine(81 title_prefix = schema.Choice( 75 82 title = u'Title prefix', 83 vocabulary = inst_types, 76 84 default = u'department', 77 85 required = True, … … 80 88 courses = Attribute("A container for courses.") 81 89 certificates = Attribute("A container for certificates.") 82 90 91 def longtitle(): 92 """ 93 Returns the long title of a department. 94 """ 95 83 96 class IDepartmentAdd(IDepartment): 84 97 """Representation of a university department. -
main/waeup.sirp/trunk/src/waeup/sirp/university/vocabularies.py
r5986 r5988 10 10 from zope.app.catalog.interfaces import ICatalog 11 11 from zope.component import getUtility 12 13 inst_types = SimpleWAeUPVocabulary( 14 ('Faculty of','faculty'), 15 ('Department of','department'), 16 ('School of','school_of'), 17 ('School for','school_for'), 18 ('Institute of','institute'), 19 ('Office for','office'), 20 ('Centre for','centre'), 21 ('College','college'), 22 ) 12 23 13 24 course_levels = SimpleWAeUPVocabulary(
Note: See TracChangeset for help on using the changeset viewer.