Changeset 452 for WAeUP_SRP/trunk
- Timestamp:
- 30 Aug 2006, 12:31:46 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Students.py
r446 r452 198 198 logger.error('Error reading %s.csv' % name) 199 199 return 200 l = self.portal_catalog({'meta_type': "Student"})201 students = {}202 for s in l:203 students[s.id] = s.getObject()200 ## l = self.portal_catalog({'meta_type': "Student"}) 201 ## students = {} 202 ## for s in l: 203 ## students[s.id] = s.getObject() 204 204 l = self.portal_catalog({'meta_type': "Course"}) 205 205 courses = {} … … 208 208 for result in results: 209 209 sid = result.get('Matnumber') 210 if sid not in students.keys(): 210 res = self.portal_catalog({'meta_type': "StudentClearance", 211 'matric_no': sid }) 212 if not res: 211 213 em = 'Student with ID %(Matnumber)s not found\n' % result 212 214 logger.info(em) … … 214 216 no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result) 215 217 continue 218 sf = res[0].getObject().aq_parent 219 print sf 216 220 course = result.get('CosCode') 217 221 if course not in courses.keys(): … … 230 234 no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result) 231 235 continue 232 sf = students.get(sid)233 236 sc = getattr(sf,'study_course') 234 237 l = getattr(sc,level,None) … … 238 241 sc.invokeFactory('StudyLevel', level) 239 242 l = getattr(sc, level) 240 l.getContent().edit(mapping={'Title': "Level %s" % level})243 #l.getContent().edit(mapping={'Title': "Level %s" % level}) 241 244 l.invokeFactory('Semester','first') 242 245 l.invokeFactory('Semester','second') … … 249 252 if snr == "2": 250 253 semester = getattr(l,'second') 251 logger.info('Creating CourseTicket %(CourseTicket)s in Level %(Level)s for %(Matnumber)s' % result)254 logger.info('Creating CourseTicket %(CosCode)s in Level %(Level)s for %(Matnumber)s' % result) 252 255 semester.invokeFactory('CourseTicket',course) 253 256 ct = getattr(semester,course) -
WAeUP_SRP/trunk/__init__.py
r445 r452 4 4 from Products.CMFCore.DirectoryView import registerDirectory 5 5 from Products.CMFCore import utils as cmfutils 6 from Products.CMFCore. CMFCorePermissions import AddPortalContent6 from Products.CMFCore.permissions import AddPortalContent 7 7 8 8 from Products.GenericSetup import profile_registry … … 16 16 17 17 import Products.WAeUP_SRP.WAeUPPermissions 18 from Products.WAeUP_SRP.Academics import AcademicsFolder, addAcademicsFolder19 from Products.WAeUP_SRP.University import University, addUniversity20 from Products.WAeUP_SRP.Accommodation import AccoFolder, addAccoFolder21 from Products.WAeUP_SRP.Accommodation import Accommodation, addAccommodation22 from Products.WAeUP_SRP.Academics import Certificate, addCertificate23 from Products.WAeUP_SRP.Academics import CertificateCourse, addCertificateCourse24 from Products.WAeUP_SRP.Academics import Faculty, addFaculty25 from Products.WAeUP_SRP.Academics import Department, addDepartment26 from Products.WAeUP_SRP.Academics import Course, addCourse27 from Products.WAeUP_SRP.Academics import CourseTicket, addCourseTicket28 from Products.WAeUP_SRP.Academics import CertificateCourse, addCertificateCourse29 from Products.WAeUP_SRP.Students import StudentsFolder, addStudentsFolder30 from Products.WAeUP_SRP.Students import Student, addStudent31 from Products.WAeUP_SRP.Students import StudentStudyCourse, addStudentStudyCourse32 from Products.WAeUP_SRP.Students import StudentAdmission, addStudentAdmission33 from Products.WAeUP_SRP.Students import StudentClearance, addStudentClearance34 from Products.WAeUP_SRP.Students import StudentPersonal, addStudentPersonal35 from Products.WAeUP_SRP.Students import ScratchCardBatch, addScratchCardBatch36 from Products.WAeUP_SRP.Students import ScratchCardBatchesFolder, addScratchCardBatchesFolder37 from Products.WAeUP_SRP.Students import StudyLevel, addStudyLevel38 from Products.WAeUP_SRP.Students import Semester, addSemester39 40 18 41 19 import Widgets 42 20 43 contentClasses = (44 University,45 AcademicsFolder,46 Certificate,47 CertificateCourse,48 Faculty,49 Department,50 Course,51 CourseTicket,52 CertificateCourse,53 AccoFolder,54 Accommodation,55 StudentsFolder,56 Student,57 StudentStudyCourse,58 StudentAdmission,59 StudentClearance,60 StudentPersonal,61 ScratchCardBatch,62 ScratchCardBatchesFolder,63 StudyLevel,64 Semester,21 waeup_types = ( 22 "University.University", 23 "Academics.AcademicsFolder", 24 "Academics.Certificate", 25 "Academics.CertificateCourse", 26 "Academics.Faculty", 27 "Academics.Department", 28 "Academics.Course", 29 "Academics.CourseTicket", 30 "Academics.CertificateCourse", 31 "Accommodation.AccoFolder", 32 "Accommodation.Accommodation", 33 "Students.StudentsFolder", 34 "Students.Student", 35 "Students.StudentStudyCourse", 36 "Students.StudentAdmission", 37 "Students.StudentClearance", 38 "Students.StudentPersonal", 39 "Students.ScratchCardBatch", 40 "Students.ScratchCardBatchesFolder", 41 "Students.StudyLevel", 42 "Students.Semester", 65 43 ) 66 44 67 contentConstructors = ( 68 addUniversity, 69 addAcademicsFolder, 70 addCertificate, 71 addCertificateCourse, 72 addFaculty, 73 addDepartment, 74 addCourse, 75 addCourseTicket, 76 addCertificateCourse, 77 addAccoFolder, 78 addAccommodation, 79 addStudentsFolder, 80 addStudent, 81 addStudentStudyCourse, 82 addStudentAdmission, 83 addStudentClearance, 84 addStudentPersonal, 85 addScratchCardBatch, 86 addScratchCardBatchesFolder, 87 addStudyLevel, 88 addSemester, 89 ) 45 contentClasses = [] 46 cc = [] 47 for t in waeup_types: 48 module,name = t.split('.') 49 mod = __import__('Products.WAeUP_SRP.%(module)s' % vars(), 50 globals(), 51 locals(), 52 ["%(name)s" % vars(),"add%(name)s" % vars()] 53 ) 54 contentClasses.append(getattr(mod,name)) 55 cc.append(getattr(mod,"add%(name)s" % vars())) 56 contentConstructors = tuple(cc) 90 57 91 58 fti = [{} for t in range(len(contentConstructors))] 92 ##fti = (93 ## {}, # University94 ## {}, #AcademicsFolder95 ## {}, #Certificate96 ## {}, #CertificateCourse97 ## {}, # Faculty98 ## {}, # Department99 ## {}, # Course100 ## {}, # CourseTicket101 ## {}, # CertificateCourse102 ## {}, # AccoFolder103 ## {}, # Accommodation104 ## {}, # StudentsFolder,105 ## {}, # Student,106 ## {}, # StudentStudyCourse,107 ## {}, # StudentAdmission,108 ## {}, # StudentClearance,109 ## {}, # StudentAdmission,110 ## {}, # StudentClearance,111 ## {}, # StudentPersonal,112 ## {}, # ScratchCardBatch,113 ## {}, # ScratchCardBatchesFolder,114 ## {}, # StudyLevel,115 ## {}, # Semester,116 ## )117 59 118 60 registerDirectory('skins', globals()) -
WAeUP_SRP/trunk/profiles/default/types/CourseTicket.xml
r396 r452 14 14 <property name="allow_discussion">False</property> 15 15 <property name="cps_is_searchable">True</property> 16 <property name="cps_proxy_type"> cpsdocument</property>16 <property name="cps_proxy_type"></property> 17 17 <property name="cps_display_as_document_in_listing">True</property> 18 18 <property name="schemas"> 19 <element value="metadata"/>20 <element value="common"/>21 19 <element value="course"/> 22 20 <element value="course_results"/> 23 21 </property> 24 22 <property name="layouts"> 25 <element value="waeup_common"/>26 <element value="course"/>27 23 <element value="course_results"/> 28 24 </property> 29 <property name="layout_clusters"> 30 <element value="metadata:metadata"/> 31 </property> 25 <property name="layout_clusters"/> 32 26 <property name="flexible_layouts"/> 33 27 <property name="storage_methods"/> … … 40 34 <permission value="View"/> 41 35 </action> 42 <action title="action_metadata" action_id="metadata" category="object" 43 condition_expr="python:member and 'Manager' in member.getRoles()" 44 url_expr="string:${object_url}/cpsdocument_metadata" visible="True"/> 45 <action title="Delegate" action_id="localroles" category="object" 46 condition_expr="" url_expr="string:${object_url}/folder_localrole_form" 47 visible="False"/> 36 <action title="action_edit" action_id="edit" category="object" 37 condition_expr="" url_expr="string:${object_url}/cpsdocument_edit_form" 38 visible="True"> 39 <permission value="Modify portal content"/> 40 </action> 48 41 </object> -
WAeUP_SRP/trunk/skins/waeup_academics/academics_content_lib_info_detail_tab.pt
r435 r452 130 130 </td> 131 131 </span> 132 <span tal:condition="python: context.portal_type == 'Semester'">132 <span tal:condition="python: info['doc'].portal_type == 'CertificateCourse'"> 133 133 <td> 134 134 <span tal:content="info/core_or_elective">ID</span>
Note: See TracChangeset for help on using the changeset viewer.