source: main/waeup.aaue/trunk/src/waeup/aaue/students/export.py @ 11868

Last change on this file since 11868 was 11546, checked in by Henrik Bettermann, 11 years ago

Adapt exporters and batch processors to customized interfaces.

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1## $Id: export.py 11546 2014-03-27 11:14:00Z henrik $
2##
3## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18"""Exporters for student related stuff.
19"""
20from waeup.aaue.students.interfaces import (
21    ICustomStudent, ICustomStudentStudyCourse,
22    ICustomStudentStudyLevel,
23    ICustomCourseTicket,
24    ICustomStudentOnlinePayment)
25from kofacustom.nigeria.students.export import (
26    NigeriaStudentsExporter, NigeriaStudentStudyCourseExporter,
27    NigeriaStudentStudyLevelExporter,
28    NigeriaCourseTicketExporter, NigeriaStudentPaymentsExporter)
29from waeup.kofa.utils.helpers import iface_names
30
31class CustomStudentsExporter(NigeriaStudentsExporter):
32    """Exporter for Students.
33    """
34
35    fields = tuple(sorted(iface_names(
36        ICustomStudent, omit=['loggerInfo']))) + (
37        'password', 'state', 'history', 'certcode', 'is_postgrad',
38        'current_level', 'current_session')
39
40class CustomStudentStudyCourseExporter(NigeriaStudentStudyCourseExporter):
41    """Exporter for StudentStudyCourses.
42    """
43
44    fields = tuple(
45        sorted(iface_names(ICustomStudentStudyCourse))) + ('student_id',)
46
47class CustomCourseTicketExporter(NigeriaCourseTicketExporter):
48    """Exporter for CourseTickets.
49    """
50
51    fields = tuple(sorted(iface_names(ICustomCourseTicket) +
52        ['level', 'code', 'level_session'])) + ('student_id',
53        'certcode', 'display_fullname')
54
55class CustomStudentStudyLevelExporter(NigeriaStudentStudyLevelExporter):
56    """Exporter for StudentStudyLevels.
57    """
58    #: Fieldnames considered by this exporter
59    fields = tuple(sorted(iface_names(
60        ICustomStudentStudyLevel) + ['level'])) + (
61        'student_id', 'number_of_tickets','certcode')
62
63class CustomStudentPaymentsExporter(NigeriaStudentPaymentsExporter):
64    """Exporter for OnlinePayment instances.
65    """
66
67    fields = tuple(
68        sorted(iface_names(
69            ICustomStudentOnlinePayment, exclude_attribs=False,
70            omit=['display_item']))) + (
71            'student_id','state','current_session')
72
Note: See TracBrowser for help on using the repository browser.