Changeset 2190 for WAeUP_SRP/trunk
- Timestamp:
- 11 Sep 2007, 10:31:57 (17 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Academics.py
r2081 r2190 215 215 not_imported.append(heading) 216 216 #no_import.write('%s\n' % heading) 217 l = self.portal_catalog({'meta_type': "Faculty"})218 facs = {}219 for f in l:220 facs[f.id] = f.getObject()217 #l = self.portal_catalog({'meta_type': "Faculty"}) 218 #facs = {} 219 #for f in l: 220 # facs[f.id] = f.getObject() 221 221 dl = self.portal_catalog({'meta_type': "Department"}) 222 222 deps = {} … … 254 254 cf = dept.courses 255 255 c = getattr(cf,course_id,None) 256 cd_fields = (('code','code'),257 ('faculty','faculty_code'),258 ('department','department_code'),259 ('title','title'),260 ('credits','credits'),261 ('level','level'),262 ('semester','semester'),263 )264 cd = {}265 for t,f in cd_fields:266 cd[t] = course[f]256 #cd_fields = (('code','code'), 257 # ('faculty','faculty_code'), 258 # ('department','department_code'), 259 # ('title','title'), 260 # ('credits','credits'), 261 # ('level','level'), 262 # ('semester','semester'), 263 # ) 264 #cd = {} 265 #for t,f in cd_fields: 266 # cd[t] = course[f] 267 267 #import pdb;pdb.set_trace() 268 268 if c is None: … … 272 272 imported.append(format % course) 273 273 c = getattr(cf,course_id) 274 self.courses_catalog.addRecord(**cd)275 else:276 self.courses_catalog.modifyRecord(**cd)274 #self.courses_catalog.addRecord(**cd) 275 #else: 276 # self.courses_catalog.modifyRecord(**cd) 277 277 c.getContent().edit(mapping=course) 278 278 review_state = course.get('review_state') … … 447 447 logger.info('Creating CertificateCourse %(code)s in Certificate %(certificate_code)s StudyLevel %(level)s' % cert_course) 448 448 cc = getattr(l,course_code) 449 semester = 'first'450 try:451 sem = int(cert_course.get('semester'))452 cert_course['semester'] = ('first','second')[sem - 1]453 except:454 pass449 #semester = 'first' 450 #try: 451 # sem = int(cert_course.get('semester')) 452 # cert_course['semester'] = ('first','second')[sem - 1] 453 #except: 454 # pass 455 455 cert_course['core_or_elective'] = cert_course['core_or_elective'] in ("TRUE","True") 456 456 cc.getContent().edit(mapping=cert_course) -
WAeUP_SRP/trunk/profiles/default/layouts/certificate_course.xml
r1404 r2190 23 23 <property name="hidden_readonly_layout_modes"/> 24 24 </widget> 25 <widget name="admin_status" meta_type="String Widget">26 <property name="title">Admin Status</property>27 <property name="fields">28 <element value="admin_status"/>29 </property>30 <property name="label">Admin Status</property>31 <property name="label_edit">Admin Status</property>32 <property name="readonly_layout_modes"/>33 <property name="hidden_layout_modes"/>34 <property name="hidden_readonly_layout_modes"/>35 </widget>36 <widget name="certificate_code" meta_type="String Widget">37 <property name="title">Certificate code</property>38 <property name="fields">39 <element value="certificate_code"/>40 </property>41 <property name="label">Certificate Code</property>42 <property name="label_edit">Certificate Code</property>43 <property name="readonly_layout_modes"/>44 <property name="hidden_layout_modes">45 <element value="edit"/>46 <element value="create"/>47 </property>48 <property name="hidden_readonly_layout_modes"/>49 </widget>50 <widget name="certificate_code_org" meta_type="String Widget">51 <property name="title">Certificate original code</property>52 <property name="fields">53 <element value="certificate_code_org"/>54 </property>55 <property name="label">Certificate original code</property>56 <property name="label_edit">Certificate original code</property>57 <property name="readonly_layout_modes"/>58 <property name="hidden_layout_modes">59 <element value="edit"/>60 <element value="create"/>61 </property>62 <property name="hidden_readonly_layout_modes"/>63 </widget>64 25 <widget name="code" meta_type="CertificateCourseId Widget"> 65 26 <property name="title">Course Code</property> … … 77 38 <property name="hidden_readonly_layout_modes"/> 78 39 </widget> 79 <widget name="code_neu" meta_type="ExtendedSelect Widget">80 <property name="title">Course Code</property>81 <property name="fields">82 <element value="code"/>83 </property>84 <property name="is_required">True</property>85 <property name="label">Course Code</property>86 <property name="label_edit">Course Code</property>87 <property name="readonly_layout_modes"/>88 <property name="hidden_layout_modes"/>89 <property name="hidden_readonly_layout_modes"/>90 <property name="vocabulary">courses_voc</property>91 </widget>92 40 <widget name="core_or_elective" meta_type="Boolean Widget"> 93 41 <property name="title">Core or Elective</property> … … 103 51 <property name="label_true">core</property> 104 52 </widget> 105 <widget name="semester" meta_type="Select Widget">106 <property name="title">Semester</property>107 <property name="fields">108 <element value="semester"/>109 </property>110 <property name="label">Semester</property>111 <property name="label_edit">Semester</property>112 <property name="readonly_layout_modes"/>113 <property name="hidden_layout_modes"/>114 <property name="hidden_readonly_layout_modes"/>115 <property name="vocabulary">semester_voc</property>116 </widget>117 53 <table> 118 54 <row> 119 55 <cell name="Title"/> 120 </row>121 <row>122 <cell name="semester"/>123 56 </row> 124 57 <row>
Note: See TracChangeset for help on using the changeset viewer.