Changeset 12104 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 1 Dec 2014, 14:43:16 (10 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r12075 r12104 71 71 from waeup.kofa.datacenter import DataCenterFile 72 72 73 from waeup.kofa.students.export import EXPORTER_NAMES as STUDENT_EXPORTERS74 73 from waeup.kofa.students.catalog import StudentQueryResultItem 74 from waeup.kofa.students.interfaces import IStudentsUtils 75 75 76 76 FORBIDDEN_CHARACTERS = (160,) … … 1581 1581 def getExporters(self): 1582 1582 utils = getUtilitiesFor(ICSVExporter) 1583 STUDENT_EXPORTER_NAMES = getUtility( 1584 IStudentsUtils).STUDENT_EXPORTER_NAMES 1583 1585 title_name_tuples = [ 1584 1586 (util.title, name) for name, util in utils 1585 if not name in STUDENT_EXPORTER S]1587 if not name in STUDENT_EXPORTER_NAMES] 1586 1588 # The exporter for access codes requires a special permission. 1587 1589 if not checkPermission('waeup.manageACBatches', self.context): -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r12048 r12104 76 76 ) 77 77 from waeup.kofa.students.catalog import search, StudentQueryResultItem 78 from waeup.kofa.students.export import EXPORTER_NAMES79 78 from waeup.kofa.students.studylevel import StudentStudyLevel, CourseTicket 80 79 from waeup.kofa.students.vocabularies import StudyLevelSource … … 3180 3179 self.exporters = exporters 3181 3180 return 3182 for name in EXPORTER_NAMES: 3181 STUDENT_EXPORTER_NAMES = getUtility( 3182 IStudentsUtils).STUDENT_EXPORTER_NAMES 3183 for name in STUDENT_EXPORTER_NAMES: 3183 3184 util = getUtility(ICSVExporter, name=name) 3184 3185 exporters.append((util.title, name),) -
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r12079 r12104 33 33 from waeup.kofa.utils.helpers import iface_names, to_timezone 34 34 35 #: A tuple containing all exporter names referring to students or36 #: subobjects thereof.37 EXPORTER_NAMES = ('students', 'studentstudycourses',38 'studentstudylevels', 'coursetickets',39 'studentpayments', 'bedtickets', 'paymentsoverview',40 'studylevelsoverview', 'combocard', 'bursary')41 35 42 36 def get_students(site, stud_filter=StudentsQuery()): -
main/waeup.kofa/trunk/src/waeup/kofa/students/student.py
r11604 r12104 39 39 CREATED, ADMITTED, CLEARANCE, PAID, REGISTERED, VALIDATED, RETURNING) 40 40 from waeup.kofa.students.accommodation import StudentAccommodation 41 from waeup.kofa.students.export import EXPORTER_NAMES42 41 from waeup.kofa.students.interfaces import ( 43 IStudent, IStudentNavigation, IStudentPersonalEdit, ICSVStudentExporter) 42 IStudent, IStudentNavigation, IStudentPersonalEdit, ICSVStudentExporter, 43 IStudentsUtils) 44 44 from waeup.kofa.students.payments import StudentPaymentsContainer 45 45 from waeup.kofa.students.utils import generate_student_id … … 420 420 (column `del_date`) as a UTC timestamp. 421 421 """ 422 for name in EXPORTER_NAMES: 422 423 STUDENT_EXPORTER_NAMES = getUtility( 424 IStudentsUtils).STUDENT_EXPORTER_NAMES 425 426 for name in STUDENT_EXPORTER_NAMES: 423 427 exporter = getUtility(ICSVStudentExporter, name=name) 424 428 csv_data = exporter.export_student(student) -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_student.py
r10059 r12104 31 31 from zope.schema.interfaces import RequiredMissing 32 32 from waeup.kofa.interfaces import IExtFileStore, IFileStoreNameChooser 33 from waeup.kofa.students.export import EXPORTER_NAMES34 33 from waeup.kofa.students.student import ( 35 34 Student, StudentFactory, handle_student_removed, path_from_studid) … … 41 40 IStudent, IStudentStudyCourse, IStudentPaymentsContainer, 42 41 IStudentAccommodation, IStudentStudyLevel, ICourseTicket, IBedTicket, 43 IStudentNavigation )42 IStudentNavigation, IStudentsUtils) 44 43 from waeup.kofa.students.tests.test_batching import StudentImportExportSetup 45 44 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase … … 183 182 184 183 # The student data were put into CSV files 185 for name in EXPORTER_NAMES: 184 STUDENT_EXPORTER_NAMES = getUtility( 185 IStudentsUtils).STUDENT_EXPORTER_NAMES 186 187 for name in STUDENT_EXPORTER_NAMES: 186 188 csv_path = os.path.join(del_dir, '%s.csv' % name) 187 189 self.assertTrue(os.path.isfile(csv_path)) -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r12048 r12104 936 936 PWCHANGE_STATES = (ADMITTED,) 937 937 938 #: A tuple containing all exporter names referring to students or 939 #: subobjects thereof. 940 STUDENT_EXPORTER_NAMES = ('students', 'studentstudycourses', 941 'studentstudylevels', 'coursetickets', 942 'studentpayments', 'bedtickets', 'paymentsoverview', 943 'studylevelsoverview', 'combocard', 'bursary') 944 938 945 #: A prefix used when generating new student ids. Each student id will 939 946 #: start with this string. The default is 'K' for ``Kofa``. -
main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.txt
r9826 r12104 211 211 <implementedBy waeup.kofa.university.certificate.CertificateCourse> 212 212 213 214 Event Subscribers215 =================216 217 .. function:: removedCourseHandler(course, event)218 219 An event subscriber triggered for220 :class:`grok.IObjectRemovedEvent`s, when an :class:`ICourse`221 instance is removed from a container.222 223 Tries to remove all referring :class:`CertificateCourse`224 instances that refer to a removed course.225 226 To accomplish that, the parents of the removed course are looked up227 for a certifcate container which contains a certificate course that228 refers to the deleted course.229 230 .. seealso:: :ref:`removecertificatecourses`231 232 **handles:**233 :class:`ICourse`234 235 **event type:**236 :class:`grok.IObjectRemovedEvent`237 213 238 214 Examples
Note: See TracChangeset for help on using the changeset viewer.