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

Try to rip out all UI-related stuff from w.k.reports. Put it into views.

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

Legend:

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

    r9670 r9672  
    128128        self.data = get_students_by(session, mode)
    129129
    130     def __repr__(self):
    131         """Creates an executable representation of a StudentsReport object.
    132         """
    133         return 'StudentsReport(%r, %r, author=%r)' % (
    134             self.args[0], self.mode, self.author)
    135 
    136     #def __str__(self):
    137     #    """A nice human readable representation of a StudentsReport.
    138 
    139     #    Includes infos about session, mode and creation datetime.
    140     #    """
    141     #    return 'Students Report [session=%s, mode=%s] of %s ' % (
    142     #        self.session, self.mode, self._creation_dt_string)
    143 
    144130    @property
    145131    def title(self):
     
    169155    title = _('Students')
    170156    grok.name('students_by')
    171 
    172     @property
    173     def description(self):
    174         return self.title
    175157
    176158    def generate(self, site, session=None, mode=None, author=None):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_reports.py

    r9671 r9672  
    2020        verifyObject(IStudentsReport, obj)
    2121        return
    22 
    23     def test_repr(self):
    24         # exec(students_report.__repr__()) <=> students_report
    25         obj1 = StudentsReport(2010, 'Undergraduate Full-Time', author='Bob')
    26         self.assertEqual(
    27             obj1.__repr__(),
    28             "StudentsReport(2010, 'Undergraduate Full-Time', author='Bob')")
    29         obj_from_str = eval(obj1.__repr__())
    30         self.assertEqual(obj_from_str.session, '2010/2011')
    31         self.assertEqual(obj_from_str.mode, 'Undergraduate Full-Time')
    32         self.assertEqual(obj_from_str.author, 'Bob')
    33         return
    34 
    35     #def test_str(self):
    36     #    # StudentsReport provide a nice string representation
    37     #    obj = StudentsReport(2010, 'Undergraduate Full-Time', author='Bob')
    38     #    self.assertEqual(
    39     #        obj.__str__()[:65],
    40     #        'Students Report '
    41     #        '[session=2010/2011, mode=Undergraduate Full-Time]')
    42     #    return
    4322
    4423    def test_title(self):
Note: See TracChangeset for help on using the changeset viewer.