Changeset 8996
- Timestamp:
- 13 Jul 2012, 10:52:33 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/university
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/university/batching.py
r8995 r8996 36 36 IFacultiesContainer, IFaculty, ICourse, IDepartment, ICertificate, 37 37 ICertificateCourse) 38 from waeup.kofa.university.faculty import Faculty 38 from waeup.kofa.university import ( 39 Faculty, Department, Course, Certificate) 39 40 from waeup.kofa.utils.batching import BatchProcessor 40 41 … … 64 65 fields = getFields(self.iface) 65 66 return sorted(list(set( 66 ['local_roles'] + fields.keys()))) 67 self.location_fields + fields.keys() + ['local_roles'] 68 ))) 67 69 68 70 def entryExists(self, row, site): … … 147 149 return errs, inv_errs, conv_dict 148 150 149 class DepartmentProcessor( BatchProcessor):151 class DepartmentProcessor(FacultyProcessor): 150 152 """A batch processor for IDepartment objects. 151 153 """ … … 158 160 name = u'Department Processor' 159 161 iface = IDepartment 162 allowed_roles = Department.local_roles 160 163 161 164 location_fields = ['code', 'faculty_code'] … … 194 197 return 195 198 196 class CourseProcessor( BatchProcessor):199 class CourseProcessor(FacultyProcessor): 197 200 """A batch processor for ICourse objects. 198 201 """ … … 205 208 name = u'Course Processor' 206 209 iface = ICourse 210 allowed_roles = Course.local_roles 207 211 208 212 location_fields = ['code', 'faculty_code', 'department_code'] … … 245 249 return 246 250 247 class CertificateProcessor( BatchProcessor):251 class CertificateProcessor(FacultyProcessor): 248 252 """A batch processor for ICertificate objects. 249 253 """ … … 256 260 name = u'Certificate Processor' 257 261 iface = ICertificate 262 allowed_roles = Certificate.local_roles 258 263 259 264 location_fields = ['code'] … … 266 271 fields = getFields(self.iface) 267 272 return sorted(list(set( 268 ['faculty_code','department_code'] + fields.keys()))) 273 ['faculty_code','department_code'] + fields.keys() 274 + ['local_roles']))) 269 275 270 276 def checkHeaders(self, headerfields, mode='create'): … … 339 345 return 340 346 341 class CertificateCourseProcessor( BatchProcessor):347 class CertificateCourseProcessor(FacultyProcessor): 342 348 """A batch processor for ICertificateCourse objects. 343 349 """ -
main/waeup.kofa/trunk/src/waeup/kofa/university/course.py
r8920 r8996 29 29 """ 30 30 grok.implements(ICourse, ICourseAdd) 31 32 local_roles = [] 31 33 32 34 def __init__(self,
Note: See TracChangeset for help on using the changeset viewer.