Ignore:
Timestamp:
17 Nov 2012, 07:15:04 (12 years ago)
Author:
Henrik Bettermann
Message:

It's not a report of a single student but a report of subsets of students.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited
1 moved

Legend:

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

    r9652 r9653  
    2626from waeup.kofa.reports import IReport
    2727
    28 class IStudentReport(IReport):
     28class IStudentsReport(IReport):
    2929    pass
    3030
     
    112112    ]
    113113
    114 @implementer(IStudentReport)
    115 class StudentReport(Report):
     114@implementer(IStudentsReport)
     115class StudentsReport(Report):
    116116    data = None
    117117    session = None
     
    119119
    120120    def __init__(self, session, mode, author='System'):
    121         super(StudentReport, self).__init__(
     121        super(StudentsReport, self).__init__(
    122122            args=[session, mode], kwargs={'author':author})
    123123        self.session = academic_sessions_vocab.getTerm(session).title
     
    127127
    128128    def __repr__(self):
    129         return 'StudentReport (session=%s, mode=%s)' % (
     129        return 'StudentsReport (session=%s, mode=%s)' % (
    130130            self.session, self.mode)
    131131
     
    152152
    153153@implementer(IReportGenerator)
    154 class StudentReportGenerator(grok.GlobalUtility):
     154class StudentsReportGenerator(grok.GlobalUtility):
    155155
    156156    title = _('Students')
     
    162162
    163163    def generate(self, site, session=None, mode=None, author=None):
    164         result = StudentReport(session=session, mode=mode, author=author)
     164        result = StudentsReport(session=session, mode=mode, author=author)
    165165        return result
    166166
     
    174174from waeup.kofa.reports import get_generators
    175175grok.templatedir('browser_templates')
    176 class StudentReportGeneratorPage(KofaPage):
    177 
    178     grok.context(StudentReportGenerator)
     176class StudentsReportGeneratorPage(KofaPage):
     177
     178    grok.context(StudentsReportGenerator)
    179179    grok.name('index.html')
    180180    grok.require('waeup.manageReports')
     
    219219        return
    220220
    221 class StudentReportPDFView(grok.View):
    222 
    223     grok.context(IStudentReport)
     221class StudentsReportPDFView(grok.View):
     222
     223    grok.context(IStudentsReport)
    224224    grok.name('pdf')
    225225    grok.require('waeup.Public')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_reports.py

    r9647 r9653  
    11# Tests for student related reports
    22from waeup.kofa.students.reports import (
    3     get_students_by, StudentReport)
     3    get_students_by, StudentsReport)
    44from waeup.kofa.students.tests.test_catalog import CatalogTestSetup
    55from waeup.kofa.testing import FunctionalLayer
    66
    7 class StudentReportTests(CatalogTestSetup):
     7class StudentsReportTests(CatalogTestSetup):
    88
    99    layer = FunctionalLayer
     
    5454    def test_create_pdf(self):
    5555        self.create_cert('FAC2', 'dept2', 'CERT2')
    56         report = StudentReport(2010, 'Undergraduate Full-Time')
     56        report = StudentsReport(2010, 'Undergraduate Full-Time')
    5757        result = report.create_pdf()
    5858        self.assertTrue(result.startswith('%PDF-'))
Note: See TracChangeset for help on using the changeset viewer.