Changeset 12865


Ignore:
Timestamp:
20 Apr 2015, 06:42:44 (10 years ago)
Author:
Henrik Bettermann
Message:

Rename classes StudentPaymentsExporter? and BedTicketsExporter? to be in accordance with other exporter names.

Location:
main/waeup.kofa/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r12862 r12865  
    441.3.2.dev0 (unreleased)
    55=======================
     6
     7* Rename classes StudentPaymentsExporter and BedTicketsExporter to be
     8  in accordance with other exporter names.
    69
    710* Add ReportsManager role.
  • main/waeup.kofa/trunk/docs/source/userdocs/datacenter/export.rst

    r12863 r12865  
    137137
    138138Student Data Exporters
    139 ----------------------
     139======================
    140140
    141141When 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.
     
    183183  .. automethod:: waeup.kofa.students.export.CourseTicketExporter.mangle_value()
    184184
    185 Student Payments Exporter
    186 -------------------------
    187 
    188 .. autoclass:: waeup.kofa.students.export.StudentPaymentsExporter()
    189   :noindex:
    190 
    191   .. autoattribute:: waeup.kofa.students.export.StudentPaymentsExporter.fields
    192   .. autoattribute:: waeup.kofa.students.export.StudentPaymentsExporter.title
    193   .. automethod:: waeup.kofa.students.export.StudentPaymentsExporter.mangle_value()
    194 
    195 Bed Tickets Exporter
    196 --------------------
    197 
    198 .. autoclass:: waeup.kofa.students.export.BedTicketsExporter()
    199   :noindex:
    200 
    201   .. autoattribute:: waeup.kofa.students.export.BedTicketsExporter.fields
    202   .. autoattribute:: waeup.kofa.students.export.BedTicketsExporter.title
    203   .. automethod:: waeup.kofa.students.export.BedTicketsExporter.mangle_value()
     185Student 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
     195Bed 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()
    204204
    205205The 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  
    8383
    8484    def mangle_value(self, value, name, context=None):
    85         """The mangler determines the the codes of the atributes `course1`,
     85        """The mangler determines the codes of the atributes `course1`,
    8686        `course2` and `course_admitted`. It furthermore prepares the
    8787        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  
    350350
    351351
    352 class StudentPaymentsExporter(grok.GlobalUtility, StudentExporterBase):
    353     """The Student Payments Exporter first filters the set of students
     352class StudentPaymentExporter(grok.GlobalUtility, StudentExporterBase):
     353    """The Student Payment Exporter first filters the set of students
    354354    by searching the students catalog. Then it exports student payment
    355355    tickets by iterating over the items of the student's ``payments``
     
    379379                value = getattr(student, name, None)
    380380        return super(
    381             StudentPaymentsExporter, self).mangle_value(
    382             value, name, context=context)
    383 
    384 class DataForBursaryExporter(StudentPaymentsExporter):
     381            StudentPaymentExporter, self).mangle_value(
     382            value, name, context=context)
     383
     384class DataForBursaryExporter(StudentPaymentExporter):
    385385    """The DataForBursary Exporter works just like the Student Payments Exporter
    386386    but it exports much more information about the student. It combines
     
    418418                value = getattr(student, name, None)
    419419        return super(
    420             StudentPaymentsExporter, self).mangle_value(
    421             value, name, context=context)
    422 
    423 class BedTicketsExporter(grok.GlobalUtility, StudentExporterBase):
    424     """The Bed Tickets Exporter first filters the set of students
     420            StudentPaymentExporter, self).mangle_value(
     421            value, name, context=context)
     422
     423class BedTicketExporter(grok.GlobalUtility, StudentExporterBase):
     424    """The Bed Ticket Exporter first filters the set of students
    425425    by searching the students catalog. Then it exports bed
    426426    tickets by iterating over the items of the student's ``accommodation``
     
    452452            value = getattr(getattr(context, 'bed', None), 'bed_type')
    453453        return super(
    454             BedTicketsExporter, self).mangle_value(
     454            BedTicketExporter, self).mangle_value(
    455455            value, name, context=context)
    456456
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r12568 r12865  
    2929from waeup.kofa.students.export import (
    3030    StudentExporter, StudentStudyCourseExporter, StudentStudyLevelExporter,
    31     CourseTicketExporter, StudentPaymentsExporter, BedTicketsExporter,
     31    CourseTicketExporter, StudentPaymentExporter, BedTicketExporter,
    3232    StudentPaymentsOverviewExporter, StudentStudyLevelsOverviewExporter,
    3333    ComboCardDataExporter, DataForBursaryExporter,
     
    712712        return
    713713
    714 class StudentPaymentsExporterTest(StudentImportExportSetup):
     714class StudentPaymentExporterTest(StudentImportExportSetup):
    715715
    716716    layer = FunctionalLayer
    717717
    718718    def setUp(self):
    719         super(StudentPaymentsExporterTest, self).setUp()
     719        super(StudentPaymentExporterTest, self).setUp()
    720720        self.setup_for_export()
    721721        return
     
    723723    def test_ifaces(self):
    724724        # make sure we fullfill interface contracts
    725         obj = StudentPaymentsExporter()
     725        obj = StudentPaymentExporter()
    726726        verifyObject(ICSVStudentExporter, obj)
    727         verifyClass(ICSVStudentExporter, StudentPaymentsExporter)
     727        verifyClass(ICSVStudentExporter, StudentPaymentExporter)
    728728        return
    729729
     
    738738        payment = StudentOnlinePayment()
    739739        payment.creation_date = datetime.datetime(2012, 4, 1, 13, 12, 1)
    740         exporter = StudentPaymentsExporter()
     740        exporter = StudentPaymentExporter()
    741741        exporter.export([payment], self.outfile)
    742742        result = open(self.outfile, 'rb').read()
     
    756756        self.setup_student(self.student)
    757757        payment = self.student['payments']['my-payment']
    758         exporter = StudentPaymentsExporter()
     758        exporter = StudentPaymentExporter()
    759759        exporter.export([payment], self.outfile)
    760760        result = open(self.outfile, 'rb').read()
     
    775775        # set values we can expect in export file
    776776        self.setup_student(self.student)
    777         exporter = StudentPaymentsExporter()
     777        exporter = StudentPaymentExporter()
    778778        exporter.export_all(self.app, self.outfile)
    779779        result = open(self.outfile, 'rb').read()
     
    794794        # set values we can expect in export file
    795795        self.setup_student(self.student)
    796         exporter = StudentPaymentsExporter()
     796        exporter = StudentPaymentExporter()
    797797        exporter.export_student(self.student, self.outfile)
    798798        result = open(self.outfile, 'rb').read()
     
    815815        notify(grok.ObjectModifiedEvent(self.student))
    816816
    817         exporter = StudentPaymentsExporter()
     817        exporter = StudentPaymentExporter()
    818818        exporter.export_filtered(
    819819            self.student, self.outfile, current_level=200)
     
    836836        self.app['students'].addStudent(self.student)
    837837        notify(grok.ObjectModifiedEvent(self.student))
    838         exporter = StudentPaymentsExporter()
     838        exporter = StudentPaymentExporter()
    839839        # A key xxx does not exist
    840840        self.assertRaises(
     
    926926        return
    927927
    928 class BedTicketsExporterTest(StudentImportExportSetup):
     928class BedTicketExporterTest(StudentImportExportSetup):
    929929
    930930    layer = FunctionalLayer
    931931
    932932    def setUp(self):
    933         super(BedTicketsExporterTest, self).setUp()
     933        super(BedTicketExporterTest, self).setUp()
    934934        self.setup_for_export()
    935935        return
     
    937937    def test_ifaces(self):
    938938        # make sure we fullfill interface contracts
    939         obj = BedTicketsExporter()
     939        obj = BedTicketExporter()
    940940        verifyObject(ICSVStudentExporter, obj)
    941         verifyClass(ICSVStudentExporter, BedTicketsExporter)
     941        verifyClass(ICSVStudentExporter, BedTicketExporter)
    942942        return
    943943
     
    953953        bed = self.app['hostels']['hall-1']['hall-1_A_101_A']
    954954        bedticket.bed = bed
    955         exporter = BedTicketsExporter()
     955        exporter = BedTicketExporter()
    956956        exporter.export([bedticket], self.outfile)
    957957        result = open(self.outfile, 'rb').read()
     
    969969        self.setup_student(self.student)
    970970        bedticket = self.student['accommodation']['2004']
    971         exporter = BedTicketsExporter()
     971        exporter = BedTicketExporter()
    972972        exporter.export([bedticket], self.outfile)
    973973        result = open(self.outfile, 'rb').read()
     
    985985        # set values we can expect in export file
    986986        self.setup_student(self.student)
    987         exporter = BedTicketsExporter()
     987        exporter = BedTicketExporter()
    988988        exporter.export_all(self.app, self.outfile)
    989989        result = open(self.outfile, 'rb').read()
     
    10011001        # set values we can expect in export file
    10021002        self.setup_student(self.student)
    1003         exporter = BedTicketsExporter()
     1003        exporter = BedTicketExporter()
    10041004        exporter.export_student(self.student, self.outfile)
    10051005        result = open(self.outfile, 'rb').read()
     
    10191019        notify(grok.ObjectModifiedEvent(self.student))
    10201020
    1021         exporter = BedTicketsExporter()
     1021        exporter = BedTicketExporter()
    10221022        exporter.export_filtered(
    10231023            self.student, self.outfile, current_level=200)
Note: See TracChangeset for help on using the changeset viewer.