Changeset 9316 for main/waeup.kofa/trunk


Ignore:
Timestamp:
8 Oct 2012, 13:19:14 (12 years ago)
Author:
Henrik Bettermann
Message:

We need to import credits and passmark of course tickets in order to repair them. Let's use the form field validation for import.

Both passmark and credits must not be edited via the UI.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py

    r9315 r9316  
    545545
    546546    location_fields = []
    547     additional_fields = ['level', 'code', 'credits']
     547    additional_fields = ['level', 'code']
    548548    additional_headers = ['level', 'code']
    549549
     
    579579        obj.dcode = entries[0].__parent__.__parent__.code
    580580        obj.title = entries[0].title
    581         obj.credits = entries[0].credits
    582         obj.passmark = entries[0].passmark
     581        if getattr(obj, 'credits', None) is None:
     582            obj.credits = entries[0].credits
     583        if getattr(obj, 'passmark', None) is None:
     584            obj.passmark = entries[0].passmark
    583585        obj.semester = entries[0].semester
    584586        parent[row['code']] = obj
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r9280 r9316  
    11201120    label = _('Add course ticket')
    11211121    form_fields = grok.AutoFields(ICourseTicketAdd).omit(
    1122         'score', 'automatic', 'carry_over')
     1122        'score', 'automatic', 'carry_over', 'credits', 'passmark')
    11231123    pnav = 4
    11241124
     
    11721172    grok.name('manage')
    11731173    grok.require('waeup.manageStudent')
    1174     form_fields = grok.AutoFields(ICourseTicket)
     1174    form_fields = grok.AutoFields(ICourseTicket).omit('credits', 'passmark')
    11751175    grok.template('courseticketmanagepage')
    11761176    pnav = 4
     
    21072107    grok.require('waeup.handleStudent')
    21082108    form_fields = grok.AutoFields(ICourseTicketAdd).omit(
    2109         'score', 'mandatory', 'automatic', 'carry_over')
     2109        'score', 'mandatory', 'automatic', 'carry_over', 'credits', 'passmark')
    21102110
    21112111    def update(self):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/export.py

    r9278 r9316  
    210210    #: Fieldnames considered by this exporter
    211211    fields = tuple(sorted(iface_names(ICourseTicket) +
    212         ['level', 'code', 'title', 'credits',
    213         'passmark', 'semester', 'fcode', 'dcode'])) + ('student_id', 'certcode')
     212        ['level', 'code', 'title',
     213        'semester', 'fcode', 'dcode'])) + ('student_id', 'certcode')
    214214
    215215    #: The title under which this exporter will be displayed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r9296 r9316  
    512512        )
    513513
     514    credits = schema.Int(
     515        title = _(u'Credits'),
     516        required = False,
     517        )
     518
     519    passmark = schema.Int(
     520        title = _(u'Passmark'),
     521        required = False,
     522        )
     523
    514524    def getLevel():
    515525        """Returns the id of the level the ticket has been added to.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py

    r9315 r9316  
    124124        self.fcode = None
    125125        self.dcode = None
    126         self.credits = 0
    127         self.passmark = 0
    128126        self.semester = None
    129127        return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r9315 r9316  
    293293            'automatic,carry_over,code,credits,dcode,fcode,level,mandatory,'
    294294            'passmark,score,semester,title,student_id,certcode\r\n'
    295             '0,0,,0,,,,0,0,0,,,,\r\n'
     295            '0,0,,,,,,0,,0,,,,\r\n'
    296296            )
    297297        return
Note: See TracChangeset for help on using the changeset viewer.