Changeset 14642


Ignore:
Timestamp:
22 Mar 2017, 10:24:10 (8 years ago)
Author:
Henrik Bettermann
Message:

Add course_category attribute to course tickets. In the base package,
this attribute is omitted from display and manage pages.

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

Legend:

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

    r14638 r14642  
    441.6.dev0 (unreleased)
    55=======================
     6
     7* Add `course_category` attribute to course tickets. In the base package,
     8  this attribute is omitted from display and manage pages.
    69
    710* Add `course_category` attribute to certificate courses.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py

    r14574 r14642  
    658658            'student_id','reg_number','matric_number',
    659659            'mandatory', 'score', 'carry_over', 'automatic',
    660             'outstanding', 'level_session',
     660            'outstanding', 'course_category', 'level_session',
    661661            'title', 'credits', 'passmark', 'semester'
    662662            ] + self.additional_fields
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r14584 r14642  
    132132        value_dict['outstanding'] = translate(str(value.outstanding), 'zope',
    133133            target_language=lang)
     134        value_dict['course_category'] = translate(str(value.course_category),
     135            'zope', target_language=lang)
    134136        value_dict['automatic'] = translate(str(value.automatic), 'zope',
    135137            target_language=lang)
     
    16581660    grok.name('index')
    16591661    grok.require('waeup.viewStudent')
    1660     form_fields = grok.AutoFields(ICourseTicket)
     1662    form_fields = grok.AutoFields(ICourseTicket).omit('course_category')
    16611663    grok.template('courseticketpage')
    16621664    pnav = 4
     
    16741676    grok.name('manage')
    16751677    grok.require('waeup.manageStudent')
    1676     form_fields = grok.AutoFields(ICourseTicket)
     1678    form_fields = grok.AutoFields(ICourseTicket).omit('course_category')
    16771679    form_fields['title'].for_display = True
    16781680    form_fields['fcode'].for_display = True
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r14584 r14642  
    3434    IPaymentsContainer, IOnlinePayment)
    3535from waeup.kofa.university.vocabularies import (
    36     CourseSource, StudyModeSource, CertificateSource, SemesterSource,
     36    CourseSource, StudyModeSource, CertificateSource,
     37    SemesterSource, CourseCategorySource
    3738    )
    3839
     
    697698        )
    698699
     700    course_category = schema.Choice(
     701        title = _(u'Course Category'),
     702        source = CourseCategorySource(),
     703        required = False,
     704        )
     705
    699706    score = schema.Int(
    700707        title = _(u'Score'),
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py

    r14574 r14642  
    264264                ticket.mandatory = val.mandatory
    265265                ticket.carry_over = False
     266                ticket.course_category = val.course_category
    266267                self.addCourseTicket(ticket, val.course)
    267268        return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r14584 r14642  
    25192519        self.assertTrue(
    25202520            self.student['studycourse']['200']['COURSE1'].carry_over is True)
     2521        self.assertTrue(
     2522            self.student['studycourse']['200']['COURSE1'].course_category is None)
    25212523        # Students can open the pdf course registration slip
    25222524        self.browser.open(self.student_path + '/studycourse/200')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r14596 r14642  
    613613        self.assertEqual(
    614614            result,
    615             'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
     615            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    616616            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    617617            'display_fullname\r\n'
    618             '0,0,,,,,,,0,0,,,,,,,\r\n'
     618            '0,0,,,,,,,,0,0,,,,,,,\r\n'
    619619            )
    620620        return
     
    632632        self.assertEqual(
    633633            result,
    634             'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
     634            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    635635            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    636636            'display_fullname\r\n'
    637             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     637            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
    638638            'Anna M. Tester\r\n'
    639639            )
     
    649649        self.assertEqual(
    650650            result,
    651             'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
     651            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    652652            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    653653            'display_fullname\r\n'
    654             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     654            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
    655655            'Anna M. Tester\r\n'
    656656            )
     
    665665        self.assertEqual(
    666666            result,
    667             'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
     667            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    668668            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    669669            'display_fullname\r\n'
    670             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     670            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
    671671            'Anna M. Tester\r\n'
    672672            )
     
    685685        self.assertEqual(
    686686            result,
    687             'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
     687            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    688688            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    689689            'display_fullname\r\n'
    690             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     690            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
    691691            'Anna M. Tester\r\n'
    692692            )
     
    699699        self.assertEqual(
    700700            result,
    701             'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
     701            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    702702            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    703703            'display_fullname\r\n'
    704             '1,1,CRS1,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     704            '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,Course 1,A111111,CERT1,'
    705705            'Anna M. Tester\r\n'
    706706            )
     
    710710        self.assertEqual(
    711711            result,
    712             'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
     712            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    713713            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    714714            'display_fullname\r\n'
     
    723723        self.assertEqual(
    724724            result,
    725             'automatic,carry_over,code,credits,dcode,fcode,level,level_session,'
     725            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
    726726            'mandatory,outstanding,passmark,score,semester,title,student_id,certcode,'
    727727            'display_fullname\r\n'
    728             '1,1,CRS1,100,DEP1,FAC1,110,2012,0,0,100,,2,Course 1,A111111,CERT1,'
     728            '1,1,CRS1,,100,DEP1,FAC1,110,2012,0,0,100,,2,Course 1,A111111,CERT1,'
    729729            'Anna M. Tester\r\n'
    730730            )
Note: See TracChangeset for help on using the changeset viewer.