Changeset 12896 for main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
- Timestamp:
- 1 May 2015, 05:45:41 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r12448 r12896 516 516 return None, payment 517 517 518 def increaseMatricInteger(self, student): 519 """Increase counter for matric numbers. 520 521 This counter can be a centrally stored attribute or an attribute of 522 faculties, departments or certificates. In the base package the counter 523 is as an attribute of the site configuration object. 524 """ 525 grok.getSite()['configuration'].next_matric_integer += 1 526 return 527 518 528 def constructMatricNumber(self, student): 529 """Fetch the matric number counter which fits the student and 530 construct the new matric number of the student. 531 532 In the base package the counter value is returned. 533 """ 519 534 next_integer = grok.getSite()['configuration'].next_matric_integer 520 535 if next_integer == 0: … … 526 541 527 542 If the student's matric number is unset a new matric number is 528 constructed using the next_matric_integer attribute of 529 the site configuration container and according to the 530 matriculation number construction rules defined in the 531 constructMatricNumber method. The new matric number is set, 532 the students catalog updated and next_matric_integer 533 increased by one. 543 constructed according to the matriculation number construction rules 544 defined in the constructMatricNumber method. The new matric number is 545 set, the students catalog updated. The corresponding matric number 546 counter is increased by one. 534 547 535 548 This method is tested but not used in the base package. It can 536 549 be used in custom packages by adding respective views 537 and by customizing constructMatricNumber according to the538 university's matriculation number construction rules.539 540 The method can be disabled by setting next_matric_integer to zero.550 and by customizing increaseMatricInteger and constructMatricNumber 551 according to the university's matriculation number construction rules. 552 553 The method can be disabled by setting the counter to zero. 541 554 """ 542 555 if student.matric_number is not None: … … 552 565 return _('Matriculation number exists.'), None 553 566 notify(grok.ObjectModifiedEvent(student)) 554 grok.getSite()['configuration'].next_matric_integer += 1567 self.increaseMatricInteger(student) 555 568 return None, matric_number 556 569
Note: See TracChangeset for help on using the changeset viewer.