Changeset 12865 for main/waeup.kofa
- Timestamp:
- 20 Apr 2015, 06:42:44 (10 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r12862 r12865 4 4 1.3.2.dev0 (unreleased) 5 5 ======================= 6 7 * Rename classes StudentPaymentsExporter and BedTicketsExporter to be 8 in accordance with other exporter names. 6 9 7 10 * Add ReportsManager role. -
main/waeup.kofa/trunk/docs/source/userdocs/datacenter/export.rst
r12863 r12865 137 137 138 138 Student Data Exporters 139 ---------------------- 139 ====================== 140 140 141 141 When starting a Student Data Exporter in the Data Center all student records will be taken into consideration, no matter what or where a student is studying. The exporter can also be started 'locally' at various levels in the academic section. Starting one of the exporters e.g. at faculty or department level means that only the data of students are exported who study in this faculty or department respectively. The exporter can also be started at certificate level. Then only the data of students, who are studying the named study course, will be taken into account. At course level the data of those students are being exported who have attended or taken this specific course. … … 183 183 .. automethod:: waeup.kofa.students.export.CourseTicketExporter.mangle_value() 184 184 185 Student Payment sExporter186 ------------------------ -187 188 .. autoclass:: waeup.kofa.students.export.StudentPayment sExporter()189 :noindex: 190 191 .. autoattribute:: waeup.kofa.students.export.StudentPayment sExporter.fields192 .. autoattribute:: waeup.kofa.students.export.StudentPayment sExporter.title193 .. automethod:: waeup.kofa.students.export.StudentPayment sExporter.mangle_value()194 195 Bed Ticket sExporter196 ------------------- -197 198 .. autoclass:: waeup.kofa.students.export.BedTicket sExporter()199 :noindex: 200 201 .. autoattribute:: waeup.kofa.students.export.BedTicket sExporter.fields202 .. autoattribute:: waeup.kofa.students.export.BedTicket sExporter.title203 .. automethod:: waeup.kofa.students.export.BedTicket sExporter.mangle_value()185 Student Payment Exporter 186 ------------------------ 187 188 .. autoclass:: waeup.kofa.students.export.StudentPaymentExporter() 189 :noindex: 190 191 .. autoattribute:: waeup.kofa.students.export.StudentPaymentExporter.fields 192 .. autoattribute:: waeup.kofa.students.export.StudentPaymentExporter.title 193 .. automethod:: waeup.kofa.students.export.StudentPaymentExporter.mangle_value() 194 195 Bed Ticket Exporter 196 ------------------- 197 198 .. autoclass:: waeup.kofa.students.export.BedTicketExporter() 199 :noindex: 200 201 .. autoattribute:: waeup.kofa.students.export.BedTicketExporter.fields 202 .. autoattribute:: waeup.kofa.students.export.BedTicketExporter.title 203 .. automethod:: waeup.kofa.students.export.BedTicketExporter.mangle_value() 204 204 205 205 The above exporters refer to a specific content type (object class). They export all attributes of these objects and a few additional parameters derived from the parent objects. These exporters can be used for reimport, or more precisely for backing up and restoring data. The following 'special' exporters are made on request of some universities to collect and compose student data for analysis and postprocessing by the university. -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/export.py
r12862 r12865 83 83 84 84 def mangle_value(self, value, name, context=None): 85 """The mangler determines the thecodes of the atributes `course1`,85 """The mangler determines the codes of the atributes `course1`, 86 86 `course2` and `course_admitted`. It furthermore prepares the 87 87 history messages and adds a hash symbol at the end of the phone number -
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r12862 r12865 350 350 351 351 352 class StudentPayment sExporter(grok.GlobalUtility, StudentExporterBase):353 """The Student Payment sExporter first filters the set of students352 class StudentPaymentExporter(grok.GlobalUtility, StudentExporterBase): 353 """The Student Payment Exporter first filters the set of students 354 354 by searching the students catalog. Then it exports student payment 355 355 tickets by iterating over the items of the student's ``payments`` … … 379 379 value = getattr(student, name, None) 380 380 return super( 381 StudentPayment sExporter, self).mangle_value(382 value, name, context=context) 383 384 class DataForBursaryExporter(StudentPayment sExporter):381 StudentPaymentExporter, self).mangle_value( 382 value, name, context=context) 383 384 class DataForBursaryExporter(StudentPaymentExporter): 385 385 """The DataForBursary Exporter works just like the Student Payments Exporter 386 386 but it exports much more information about the student. It combines … … 418 418 value = getattr(student, name, None) 419 419 return super( 420 StudentPayment sExporter, self).mangle_value(421 value, name, context=context) 422 423 class BedTicket sExporter(grok.GlobalUtility, StudentExporterBase):424 """The Bed Ticket sExporter first filters the set of students420 StudentPaymentExporter, self).mangle_value( 421 value, name, context=context) 422 423 class BedTicketExporter(grok.GlobalUtility, StudentExporterBase): 424 """The Bed Ticket Exporter first filters the set of students 425 425 by searching the students catalog. Then it exports bed 426 426 tickets by iterating over the items of the student's ``accommodation`` … … 452 452 value = getattr(getattr(context, 'bed', None), 'bed_type') 453 453 return super( 454 BedTicket sExporter, self).mangle_value(454 BedTicketExporter, self).mangle_value( 455 455 value, name, context=context) 456 456 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r12568 r12865 29 29 from waeup.kofa.students.export import ( 30 30 StudentExporter, StudentStudyCourseExporter, StudentStudyLevelExporter, 31 CourseTicketExporter, StudentPayment sExporter, BedTicketsExporter,31 CourseTicketExporter, StudentPaymentExporter, BedTicketExporter, 32 32 StudentPaymentsOverviewExporter, StudentStudyLevelsOverviewExporter, 33 33 ComboCardDataExporter, DataForBursaryExporter, … … 712 712 return 713 713 714 class StudentPayment sExporterTest(StudentImportExportSetup):714 class StudentPaymentExporterTest(StudentImportExportSetup): 715 715 716 716 layer = FunctionalLayer 717 717 718 718 def setUp(self): 719 super(StudentPayment sExporterTest, self).setUp()719 super(StudentPaymentExporterTest, self).setUp() 720 720 self.setup_for_export() 721 721 return … … 723 723 def test_ifaces(self): 724 724 # make sure we fullfill interface contracts 725 obj = StudentPayment sExporter()725 obj = StudentPaymentExporter() 726 726 verifyObject(ICSVStudentExporter, obj) 727 verifyClass(ICSVStudentExporter, StudentPayment sExporter)727 verifyClass(ICSVStudentExporter, StudentPaymentExporter) 728 728 return 729 729 … … 738 738 payment = StudentOnlinePayment() 739 739 payment.creation_date = datetime.datetime(2012, 4, 1, 13, 12, 1) 740 exporter = StudentPayment sExporter()740 exporter = StudentPaymentExporter() 741 741 exporter.export([payment], self.outfile) 742 742 result = open(self.outfile, 'rb').read() … … 756 756 self.setup_student(self.student) 757 757 payment = self.student['payments']['my-payment'] 758 exporter = StudentPayment sExporter()758 exporter = StudentPaymentExporter() 759 759 exporter.export([payment], self.outfile) 760 760 result = open(self.outfile, 'rb').read() … … 775 775 # set values we can expect in export file 776 776 self.setup_student(self.student) 777 exporter = StudentPayment sExporter()777 exporter = StudentPaymentExporter() 778 778 exporter.export_all(self.app, self.outfile) 779 779 result = open(self.outfile, 'rb').read() … … 794 794 # set values we can expect in export file 795 795 self.setup_student(self.student) 796 exporter = StudentPayment sExporter()796 exporter = StudentPaymentExporter() 797 797 exporter.export_student(self.student, self.outfile) 798 798 result = open(self.outfile, 'rb').read() … … 815 815 notify(grok.ObjectModifiedEvent(self.student)) 816 816 817 exporter = StudentPayment sExporter()817 exporter = StudentPaymentExporter() 818 818 exporter.export_filtered( 819 819 self.student, self.outfile, current_level=200) … … 836 836 self.app['students'].addStudent(self.student) 837 837 notify(grok.ObjectModifiedEvent(self.student)) 838 exporter = StudentPayment sExporter()838 exporter = StudentPaymentExporter() 839 839 # A key xxx does not exist 840 840 self.assertRaises( … … 926 926 return 927 927 928 class BedTicket sExporterTest(StudentImportExportSetup):928 class BedTicketExporterTest(StudentImportExportSetup): 929 929 930 930 layer = FunctionalLayer 931 931 932 932 def setUp(self): 933 super(BedTicket sExporterTest, self).setUp()933 super(BedTicketExporterTest, self).setUp() 934 934 self.setup_for_export() 935 935 return … … 937 937 def test_ifaces(self): 938 938 # make sure we fullfill interface contracts 939 obj = BedTicket sExporter()939 obj = BedTicketExporter() 940 940 verifyObject(ICSVStudentExporter, obj) 941 verifyClass(ICSVStudentExporter, BedTicket sExporter)941 verifyClass(ICSVStudentExporter, BedTicketExporter) 942 942 return 943 943 … … 953 953 bed = self.app['hostels']['hall-1']['hall-1_A_101_A'] 954 954 bedticket.bed = bed 955 exporter = BedTicket sExporter()955 exporter = BedTicketExporter() 956 956 exporter.export([bedticket], self.outfile) 957 957 result = open(self.outfile, 'rb').read() … … 969 969 self.setup_student(self.student) 970 970 bedticket = self.student['accommodation']['2004'] 971 exporter = BedTicket sExporter()971 exporter = BedTicketExporter() 972 972 exporter.export([bedticket], self.outfile) 973 973 result = open(self.outfile, 'rb').read() … … 985 985 # set values we can expect in export file 986 986 self.setup_student(self.student) 987 exporter = BedTicket sExporter()987 exporter = BedTicketExporter() 988 988 exporter.export_all(self.app, self.outfile) 989 989 result = open(self.outfile, 'rb').read() … … 1001 1001 # set values we can expect in export file 1002 1002 self.setup_student(self.student) 1003 exporter = BedTicket sExporter()1003 exporter = BedTicketExporter() 1004 1004 exporter.export_student(self.student, self.outfile) 1005 1005 result = open(self.outfile, 'rb').read() … … 1019 1019 notify(grok.ObjectModifiedEvent(self.student)) 1020 1020 1021 exporter = BedTicket sExporter()1021 exporter = BedTicketExporter() 1022 1022 exporter.export_filtered( 1023 1023 self.student, self.outfile, current_level=200)
Note: See TracChangeset for help on using the changeset viewer.