Changeset 152 for waeup_product/trunk/skins/waeup_student
- Timestamp:
- 4 Nov 2005, 17:07:18 (19 years ago)
- Location:
- waeup_product/trunk/skins/waeup_student
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/skins/waeup_student/create_jamb.py
r112 r152 37 37 elif psm == 'valid': 38 38 s_id = "s%s" % ds.get('reg_nr') 39 name = ds.get('name') 40 skw = {'title': name} 39 skw = {'title': "%(firstname)s %(lastname)s" % ds} 41 40 context.invokeFactory('Student',s_id) 42 41 student = getattr(context,s_id) … … 46 45 student.invokeFactory('Jamb',jamb_id) 47 46 jamb = getattr(student,jamb_id) 48 ds.set('title', name)47 ds.set('title', "%(reg_nr)s (%(lastname)s)" % ds) 49 48 jamb.getContent().edit(mapping=ds) 50 49 context.notifyCPSDocumentCreation(ob=jamb) … … 57 56 if noCPSMember: 58 57 pr.addMember(s_id, 'UnSeT',roles=('Member','Student','Contributor')) 58 student.manage_setLocalRoles(s_id, ['Owner']) 59 jamb.manage_setLocalRoles(s_id, ['Owner']) 60 ## student.getContent().setOwnership(s_id) 61 ## jamb.getContent().setOwnership(s_id) 59 62 ## groups = context.portal_directories.groups 60 63 ## gm = list(groups.getEntry('Students')['members']) … … 63 66 ## 'members': gm}) 64 67 return context.students_folder_view_manager(psm=psm) 65 ## return context.create_jamb_form(rendered = res,66 ## psm = psm,67 ## ds = ds,68 ## )69 70 return res,psm,ds71 68 -
waeup_product/trunk/skins/waeup_student/process_waeup_login.py
r137 r152 25 25 pd = getattr(ma,pdid) 26 26 pkw = {} 27 pkw['sex'] = getattr(jamb,'sex') 28 pkw['firstname'] = getattr(jamb,'firstname') 29 pkw['middlename'] = getattr(jamb,'middlename') 30 pkw['lastname'] = getattr(jamb,'lastname') 31 pkw['aggregate'] = getattr(jamb,'aggregate') 32 pkw['faculty'] = getattr(jamb,'faculty') 33 pkw['age'] = getattr(jamb,'age') 34 pkw['state'] = getattr(jamb,'state') 27 jc = jamb.getContent() 28 pkw['sex'] = getattr(jc,'sex') 29 pkw['firstname'] = getattr(jc,'firstname') 30 pkw['middlename'] = getattr(jc,'middlename') 31 pkw['lastname'] = getattr(jc,'lastname') 32 pkw['aggregate'] = getattr(jc,'aggregate') 33 pkw['faculty'] = getattr(jc,'faculty') 34 pkw['age'] = getattr(jc,'age') 35 pkw['state'] = getattr(jc,'state') 35 36 36 pd. edit(mapping=pkw)37 pd.getContent().edit(mapping=pkw) 37 38 context.notifyCPSDocumentCreation(ob=pd) 38 39 return response.redirect(ma.absolute_url()) -
waeup_product/trunk/skins/waeup_student/register_level.py
r142 r152 28 28 create = 1, 29 29 type_name = type_name, 30 psm = 'Not yet active',31 #psm = 'Please correct your errors',30 #psm = 'Not yet active', 31 psm = 'Please correct your errors', 32 32 ) 33 33 elif psm == '': … … 42 42 psm = (ds) 43 43 oid = ds.get('Title') 44 return context.common_edit_form(rendered = res, 44 if hasattr(context,oid): 45 return context.common_edit_form(rendered = res, 45 46 create = 1, 46 47 type_name = type_name, 47 psm = 'Not yet active', 48 #psm = 'Please correct your errors', 48 psm = 'You already registered for that level', 49 49 ) 50 51 halls = getattr(context,'accommodation').contentValues() 52 beds = [] 53 student = context.PERSONAL.getContent() 54 sf = context.getContent() 55 for hall in halls: 56 h = hall.getContent() 57 ba = int(getattr(h,'beds_assigned',0)) 58 bal = getattr(h,'beds_assigned_list',[]) 59 nr_of_beds = int(h.nr_of_blocks) * int(h.nr_of_floors) * int(h.rooms_per_floor) * int(h.beds_per_room) 60 if h.which_sex == student.sex and nr_of_beds > len(bal): 61 break 62 dict = {'heading': h.heading, 63 'text': h.text, 64 'which_sex': h.which_sex, 65 'nr_of_blocks': h.nr_of_blocks, 66 'nr_of_floors': h.nr_of_floors, 67 'rooms_per_floor': h.rooms_per_floor, 68 'beds_per_room': h.beds_per_room, 69 'nr_of_free': nr_of_beds, 70 'beds_assigned': ba, 71 } 72 ba += 1 73 dict['beds_assigned'] = ba 74 bal.append(('%s:%d' % (pm.getAuthenticatedMember(),ba))) 75 dict['beds_assigned_list'] = bal 76 psm = "h:%(heading)s free:%(nr_of_free)s %(beds_assigned)s" % dict 77 sf.edit(mapping = ds) 78 h.edit(mapping = dict) 79 #psm = "Your not admitted" 80 return context.booked_accommodation(v=dict) 50 context.invokeFactory(type_name,oid) 51 object = getattr(context,oid) 52 voc = pv.courselevel 53 ds.set('Title',voc.get(oid)) 54 object.getContent().edit(mapping=ds,proxy=object) 55 context.notifyCPSDocumentCreation(ob=object) 56 psm = 'new %s created' % oid 57 semester_id = 'Semester_1_%s_%s' % (oid,context.getId()) 58 object.invokeFactory('Semester',semester_id) 59 semester = getattr(object,semester_id) 60 semester.getContent().edit(mapping={'Title': 'First Semester'}) 61 semester_id = 'Semester_2_%s_%s' % (oid,context.getId()) 62 object.invokeFactory('Semester',semester_id) 63 semester = getattr(object,semester_id) 64 semester.getContent().edit(mapping={'Title': 'Second Semester'}) 65 context_ti = context.portal_types[context.portal_type] 66 index = context_ti.getActionById('view','university_view') 67 return getattr(context,index)(psm=psm)
Note: See TracChangeset for help on using the changeset viewer.