Changeset 429
- Timestamp:
- 26 Aug 2006, 14:06:48 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Students.py
r427 r429 4 4 from AccessControl import ClassSecurityInfo 5 5 from AccessControl.SecurityManagement import newSecurityManager 6 6 from zExceptions import BadRequest 7 7 from Products.CMFCore.utils import UniqueObject, getToolByName 8 8 from Products.CMFCore.permissions import View … … 25 25 r = random 26 26 return "%c%d" % (r.choice('ABCDEFGHKLMNPQRSTUVWXY'),r.randint(99999,1000000)) 27 28 29 27 30 28 class StudentsFolder(CPSDocument): ###( … … 95 93 #self.log('Creating Faculty %(id)s = %(Title)s' % faculty) 96 94 logger.info('%(tr_count)s: Creating Student with ID %(sid)s Matric_no %(matric_no)s ' % vars()) 97 students_folder.invokeFactory('Student', sid) 95 not_created = True 96 while not_created: 97 try: 98 students_folder.invokeFactory('Student', sid) 99 not_created = False 100 except BadRequest: 101 sid = generateStudentId() 102 logger.info('%(tr_count)s: Creating Student with ID %(sid)s Matric_no %(matric_no)s ' % vars()) 98 103 s = getattr(self,sid) 99 104 s.invokeFactory('StudentPersonal','personal')
Note: See TracChangeset for help on using the changeset viewer.