Ignore:
Timestamp:
16 Apr 2015, 18:49:08 (10 years ago)
Author:
Henrik Bettermann
Message:

Add more exporter documentation.

File:
1 edited

Legend:

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

    r12180 r12859  
    2727
    2828class AccessCodeBatchExporter(grok.GlobalUtility, ExporterBase):
    29     """Exporter for accesscodebatches.
     29    """The Access Code Batch Exporter exports container data. It does not
     30    export access codes inside the container.
    3031    """
    3132    grok.implements(ICSVExporter)
    3233    grok.name('accesscodebatches')
    3334
    34     #: Fieldnames considered by this exporter
    3535    fields = tuple(sorted(iface_names(IAccessCodeBatch))) + ('batch_id',)
    36 
    37     #: The title under which this exporter will be displayed
    3836    title = _(u'Access Code Batches')
    3937
     
    4846    def export_all(self, site, filepath=None):
    4947        """Export accesscode batches into filepath as CSV data.
    50 
    5148        If `filepath` is ``None``, a raw string with CSV data is returned.
    5249        """
     
    5754        return self.close_outfile(filepath, outfile)
    5855
     56
    5957class AccessCodeExporter(grok.GlobalUtility, ExporterBase):
    60     """Exporter for courses.
     58    """The Access Code Exporter exports all access codes stored in the
     59    access code batch containers. The exporter iterates over all access code
     60    batches and over all access codes inside each batch container.
    6161    """
    6262    grok.implements(ICSVExporter)
    6363    grok.name('accesscodes')
    6464
    65     #: Fieldnames considered by this exporter
    6665    fields = tuple(sorted(iface_names(IAccessCode)))
    67 
    68     #: The title under which this exporter will be displayed
    6966    title = _(u'Access Codes')
    7067
    7168    def mangle_value(self, value, name, context=None):
     69        """The mangler adds a hash symbol at the end of ``random_num``
     70        to avoid annoying automatic number transformation by Excel or Calc.
     71        """
    7272        if name == 'random_num' and value is not None:
    7373            # Append hash '#' to numbers to circumvent
     
    8080    def export_all(self, site, filepath=None):
    8181        """Export accesscodes into filepath as CSV data.
    82 
    8382        If `filepath` is ``None``, a raw string with CSV data is returned.
    8483        """
Note: See TracChangeset for help on using the changeset viewer.