Ignore:
Timestamp:
21 Jul 2012, 08:16:03 (12 years ago)
Author:
Henrik Bettermann
Message:

Implement SkeletonDownloadView? for downloading csv skeleton files.

Compose export filenames of portal acronym and the exporter name.

File:
1 edited

Legend:

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

    r8905 r9032  
    394394                os.path.abspath(finished_path), failed_path)
    395395
     396    def get_csv_skeleton(self):
     397        """Export CSV file only with a header of available fields.
     398
     399        A raw string with CSV data should be returned.
     400        """
     401        outfile = StringIO()
     402        writer = csv.DictWriter(outfile, self.available_fields)
     403        writer.writerow(dict(zip(self.available_fields, self.available_fields))) # header
     404        outfile.seek(0)
     405        return outfile.read()
     406
    396407class ExporterBase(object):
    397408    """A base for exporters.
Note: See TracChangeset for help on using the changeset viewer.