Changeset 9673 for main


Ignore:
Timestamp:
17 Nov 2012, 23:43:02 (12 years ago)
Author:
uli
Message:

Remove useless report title.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
3 edited

Legend:

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

    r9672 r9673  
    5252    """
    5353    title = Attribute("""Human readable description of report type.""")
     54
    5455    def generate(site, args=[], kw={}):
    5556        """Generate a report.
     
    157158class Report(object):
    158159    creation_dt = None
    159 
    160     @property
    161     def title(self):
    162         return _(u'A report')
    163160
    164161    def __init__(self, args=[], kwargs={}):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports.py

    r9672 r9673  
    128128        self.data = get_students_by(session, mode)
    129129
    130     @property
    131     def title(self):
    132         title = 'StudentsReport_%s_%s_%s' % (
    133             self.session, self.mode, self._creation_dt_string)
    134         title = title.replace('/', '_').replace(' ','_')
    135         return title
    136 
    137130    def create_pdf(self):
    138131        creator = getUtility(IPDFCreator)
     
    223216
    224217    def render(self):
    225         filename = "%s.pdf" % (self.context.title)
     218        filename = 'StudentsReport_%s_%s_%s.pdf' % (
     219            self.context.session, self.context.mode,
     220            self._creation_dt_string)
     221        filename = filename.replace(
     222            '/', '_').replace(' ','_').replace(':', '-')
    226223        self.response.setHeader(
    227224            'Content-Type', 'application/pdf')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_reports.py

    r9672 r9673  
    1919        verifyClass(IStudentsReport, StudentsReport)
    2020        verifyObject(IStudentsReport, obj)
    21         return
    22 
    23     def test_title(self):
    24         obj = StudentsReport(2010, 'Undergraduate Full-Time', author='Bob')
    25         self.assertTrue(
    26             obj.title.startswith(
    27             'StudentsReport_2010_2011_Undergraduate_Full-Time_'))
    2821        return
    2922
Note: See TracChangeset for help on using the changeset viewer.