Changeset 7907 for main


Ignore:
Timestamp:
18 Mar 2012, 14:25:25 (13 years ago)
Author:
uli
Message:

Add title attribute for exporters.

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

Legend:

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

    r7881 r7907  
    258258    """
    259259    fields = Attribute("""List of fieldnames in resulting CSV""")
    260    
     260
     261    title = schema.TextLine(
     262        title = u'Title',
     263        description = u'Description to be displayed in selections.',
     264        )
    261265    def mangle_value(value, name, obj):
    262266        """Mangle `value` extracted from `obj` or suobjects thereof.
  • main/waeup.kofa/trunk/src/waeup/kofa/university/export.py

    r7863 r7907  
    2020import grok
    2121from waeup.kofa.interfaces import ICSVExporter
     22from waeup.kofa.interfaces import MessageFactory as _
    2223from waeup.kofa.utils.batching import ExporterBase
    2324
     
    3132    fields = ('code', 'title', 'title_prefix')
    3233
     34    #: The title under which this exporter will be displayed
     35    title = _(u'Faculties')
     36
    3337    def export(self, faculties, filepath=None):
    3438        """Export `faculties`, an iterable, as CSV file.
     
    5862    #: Fieldnames considered by this exporter
    5963    fields = ('code', 'faculty_code', 'title', 'title_prefix')
     64
     65    #: The title under which this exporter will be displayed
     66    title = _(u'Departments')
    6067
    6168    def mangle_value(self, value, name, context=None):
     
    9299              'passmark', 'semester')
    93100
     101    #: The title under which this exporter will be displayed
     102    title = _(u'Courses')
     103
    94104    def mangle_value(self, value, name, context=None):
    95105        """Hook for mangling values in derived classes
     
    131141              'start_level', 'end_level', 'application_category')
    132142
     143    #: The title under which this exporter will be displayed
     144    title = _(u'Certificates')
     145
    133146    def export_all(self, site, filepath=None):
    134147        """Export faculties in facultycontainer into filepath as CSV data.
     
    153166    fields = ('course', 'faculty_code', 'department_code', 'certificate_code',
    154167              'level', 'mandatory')
     168
     169    #: The title under which this exporter will be displayed
     170    title = _(u'Courses in Certificates')
    155171
    156172    def mangle_value(self, value, name, context=None):
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py

    r7860 r7907  
    351351    fields = ('code', 'title', 'title_prefix')
    352352
     353    #: The title under which this exporter will be displayed
     354    #: (if registered as a utility)
     355    title = 'Override this title'
     356
    353357    def mangle_value(self, value, name, context=None):
    354358        """Hook for mangling values in derived classes
Note: See TracChangeset for help on using the changeset viewer.