Changeset 14638
- Timestamp:
- 21 Mar 2017, 10:13:41 (8 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r14604 r14638 4 4 1.6.dev0 (unreleased) 5 5 ======================= 6 7 * Add `course_category` attribute to certificate courses. 6 8 7 9 * Simplify configuration of maximum or minimum total credits. … … 140 142 141 143 * Configure transfer payments and let students enter their desired 142 study course. Save entered text in p_itemattribute.144 study course. Save entered text in `p_item` attribute. 143 145 144 146 * Add further permissions to the local `ApplicationsManager` role and … … 324 326 * Show flash message on general search page for the academic section. 325 327 326 * Fix CertificateCourseProcessor. Mandatory is not a required field328 * Fix `CertificateCourseProcessor`. Mandatory is not a required field 327 329 and might be missing in import files. Improve logging. Extend and 328 330 fix CertCourseProcessorTests. -
main/waeup.kofa/trunk/docs/source/userdocs/academics.rst
r14548 r14638 173 173 above). A former course cannot be part of a curriculum. 174 174 175 Certificate courses have two more attributes: `level` (integer) and 176 `mandatory` (boolean). Simply put, certificate courses carry the 177 information at which level a certain course can or has to be taken 178 to meet the current curriculum. 175 Certificate courses have three more attributes: `level` (integer), 176 `mandatory` (boolean) and `course_category` (choice). Simply put, 177 certificate courses carry the information at which level a certain 178 course can or has to be taken to meet the current curriculum. Course 179 categories are not available in the base package but can easily be 180 defined in custom packages. Some universities distinguish e.g. core, 181 required and elective courses and need this information in reports. 179 182 180 183 No local role can be assigned at certificate course tree level. -
main/waeup.kofa/trunk/src/waeup/kofa/app.py
r14511 r14638 88 88 getUtility(IKofaPluggable, name='certificates').update( 89 89 self, 'certificates', self.logger) 90 getUtility(IKofaPluggable, name='certcourses').update( 91 self, 'certcourses', self.logger) 90 92 return 91 93 attrs_to_fields(University) -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/certificatecoursepage.pt
r10650 r14638 16 16 </tr> 17 17 <tr> 18 <td i18n:translate="">Provided by:</td>18 <td class="fieldname" i18n:translate="">Provided by:</td> 19 19 <td> 20 20 <span tal:content="python: context.course.__parent__.__parent__.longtitle">DEPARTMENT</span> … … 28 28 </tr> 29 29 <tr> 30 <td i18n:translate="">Course Category:</td> 31 <td tal:content="context/course_category">NONE</td> 32 </tr> 33 <tr> 30 34 <td i18n:translate="">Required course:</td> 31 35 <td tal:content="context/mandatory">REQUIRED</td> -
main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.py
r13721 r14638 95 95 return "%s (%s)" % (self.title,self.code) 96 96 97 def addCertCourse(self, course, level=100, mandatory=True): 97 def addCertCourse(self, course, level=100, 98 mandatory=True, course_category=None): 98 99 """Add a certificate course. 99 100 """ 100 101 code = "%s_%s" % (course.code, level) 101 self[code] = CertificateCourse(course, level, mandatory )102 self[code] = CertificateCourse(course, level, mandatory, course_category) 102 103 self[code].__parent__ = self 103 104 self[code].__name__ = code … … 156 157 grok.implements(ICertificateCourse) 157 158 158 def __init__(self, course=None, level=100, mandatory=True): 159 def __init__(self, course=None, level=100, 160 mandatory=True, course_category=None): 159 161 self.course = course 160 162 self.level = level 161 163 self.mandatory = mandatory 164 self.course_category = course_category 162 165 163 166 def getCourseCode(self): … … 249 252 pass 250 253 return 254 255 class CertificateCoursesPlugin(grok.GlobalUtility): 256 """A plugin that updates certificate courses. 257 """ 258 259 grok.implements(IKofaPluggable) 260 grok.name('certcourses') 261 262 deprecated_attributes = [] 263 264 def setup(self, site, name, logger): 265 return 266 267 def update(self, site, name, logger): 268 cat = getUtility(ICatalog, name='certcourses_catalog') 269 results = cat.apply({'course_code':(None,None)}) 270 uidutil = getUtility(IIntIds, context=cat) 271 items = getFields(ICertificateCourse).items() 272 for r in results: 273 o = uidutil.getObject(r) 274 # Add new attributes 275 for i in items: 276 if not hasattr(o,i[0]): 277 setattr(o,i[0],i[1].missing_value) 278 # Remove deprecated attributes 279 for i in self.deprecated_attributes: 280 try: 281 delattr(o,i) 282 except AttributeError: 283 pass 284 return -
main/waeup.kofa/trunk/src/waeup/kofa/university/interfaces.py
r14511 r14638 31 31 SemesterSource, 32 32 DegreeSource, 33 CourseCategorySource 33 34 ) 34 35 … … 329 330 ) 330 331 332 course_category = schema.Choice( 333 title = _(u'Course Category'), 334 source = CourseCategorySource(), 335 required = False, 336 ) 337 331 338 mandatory = schema.Bool( 332 339 title = _(u'Registration required'), -
main/waeup.kofa/trunk/src/waeup/kofa/university/vocabularies.py
r13617 r14638 94 94 return "%s - %s" % (value.code, value.title[:64]) 95 95 96 class CourseCategorySource(ContextualDictSourceFactoryBase): 97 """A course category source provides additional information on 98 the course. 99 """ 100 #: name of dict to deliver from kofa utils. 101 DICT_NAME = 'COURSE_CATEGORY_DICT' 96 102 97 103 -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r14473 r14638 158 158 } 159 159 160 COURSE_CATEGORY_DICT = { 161 } 162 160 163 SPECIAL_HANDLING_DICT = { 161 164 'regular': 'Regular Hostel',
Note: See TracChangeset for help on using the changeset viewer.