1 | ## $Id: export.py 12876 2015-04-23 21:12:47Z 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 | """ |
---|
20 | from waeup.aaue.students.interfaces import ( |
---|
21 | ICustomStudent, ICustomStudentStudyCourse, |
---|
22 | ICustomStudentStudyLevel, |
---|
23 | ICustomCourseTicket, |
---|
24 | ICustomStudentOnlinePayment) |
---|
25 | from kofacustom.nigeria.students.export import ( |
---|
26 | NigeriaStudentExporter, NigeriaStudentStudyCourseExporter, |
---|
27 | NigeriaStudentStudyLevelExporter, |
---|
28 | NigeriaCourseTicketExporter, NigeriaStudentPaymentExporter) |
---|
29 | from waeup.kofa.utils.helpers import iface_names |
---|
30 | |
---|
31 | class 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 | |
---|
40 | class CustomStudentStudyCourseExporter(NigeriaStudentStudyCourseExporter): |
---|
41 | """Exporter for StudentStudyCourses. |
---|
42 | """ |
---|
43 | |
---|
44 | fields = tuple( |
---|
45 | sorted(iface_names(ICustomStudentStudyCourse))) + ('student_id',) |
---|
46 | |
---|
47 | class 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 | |
---|
55 | class CustomStudentStudyLevelExporter(NigeriaStudentStudyLevelExporter): |
---|
56 | """Exporter for StudentStudyLevels. |
---|
57 | """ |
---|
58 | #: Fieldnames considered by this exporter |
---|
59 | fields = tuple(sorted(iface_names( |
---|
60 | ICustomStudentStudyLevel))) + ( |
---|
61 | 'student_id', 'number_of_tickets','certcode') |
---|
62 | |
---|
63 | class CustomStudentPaymentExporter(NigeriaStudentPaymentExporter): |
---|
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 | |
---|