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

Last change on this file since 12700 was 12081, checked in by Henrik Bettermann, 10 years ago

Rename some exporter classes: singular not plural.

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1## $Id: export.py 12081 2014-11-28 09:53:21Z 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    NigeriaStudentExporter, NigeriaStudentStudyCourseExporter,
27    NigeriaStudentStudyLevelExporter,
28    NigeriaCourseTicketExporter, NigeriaStudentPaymentsExporter)
29from waeup.kofa.utils.helpers import iface_names
30
31class CustomStudentExporter(NigeriaStudentExporter):
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.