Changeset 9833 for main/waeup.kofa/trunk


Ignore:
Timestamp:
6 Jan 2013, 08:22:04 (12 years ago)
Author:
Henrik Bettermann
Message:

Let's define DepartmentExportJobContainerJobConfig? as a baseclass which can then also be used for the datacenter.

File:
1 edited

Legend:

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

    r9830 r9833  
    4646    IKofaObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm,
    4747    IKofaUtils, IUniversity, IObjectHistory, academic_sessions, ICSVExporter,
    48     academic_sessions_vocab, IJobManager)
     48    academic_sessions_vocab, IJobManager, IDataCenter)
    4949from waeup.kofa.interfaces import MessageFactory as _
    5050from waeup.kofa.widgets.datewidget import (
     
    26732673        return
    26742674
    2675 class DepartmentExportJobContainerJobConfig(KofaPage):
     2675class ExportJobContainerJobConfig(KofaPage):
    26762676    """Page that configures a students export job.
    2677     """
    2678     grok.context(VirtualDepartmentExportJobContainer)
     2677
     2678    This is a baseclass.
     2679    """
     2680    grok.baseclass()
     2681    grok.name('jobconfig')
    26792682    grok.require('waeup.showStudents')
    2680     grok.name('jobconfig')
    26812683    grok.template('exportjobsjobconfig')
    2682     label = _('Configure local student data export')
     2684    label = _('Configure student data export')
    26832685    pnav = 1
    26842686
     
    27122714        self.exporters = exporters
    27132715
     2716    @property
     2717    def depcode(self):
     2718        return None
     2719
    27142720    def update(self, START=None, session=None, level=None, mode=None,
    27152721               exporter=None):
     
    27262732        if mode == 'all':
    27272733            mode = None
    2728         code = self.context.__parent__.code
    27292734        self.context.start_export_job(exporter, self.request.principal.id,
    27302735                                      current_session=session,
    27312736                                      current_level=level,
    27322737                                      current_mode=mode,
    2733                                       depcode=code)
    2734         self.flash(_('Export started for students from') +
    2735                    ' %s (current_session=%s, current_level=%s, study_mode=%s)' % (
    2736                        code, session, level, mode))
    2737         self.redirect(self.url(self.context))
     2738                                      depcode=self.depcode)
     2739        self.flash(_('Export started for students with') +
     2740                   ' current_session=%s, current_level=%s, study_mode=%s' % (
     2741                   session, level, mode))
    27382742        return
    27392743
     
    27432747    grok.context(VirtualExportJobContainer)
    27442748    grok.require('waeup.showStudents')
     2749
     2750class DatacenterExportJobContainerJobConfig(ExportJobContainerJobConfig):
     2751    """Page that configures a students export job in datacenter.
     2752
     2753    """
     2754    grok.context(IDataCenter)
     2755
     2756
     2757class DepartmentExportJobContainerJobConfig(ExportJobContainerJobConfig):
     2758    """Page that configures a students export job in departments.
     2759
     2760    """
     2761    grok.context(VirtualDepartmentExportJobContainer)
     2762
     2763    @property
     2764    def depcode(self):
     2765        return self.context.__parent__.code
Note: See TracChangeset for help on using the changeset viewer.