Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/export.py	(revision 9801)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/export.py	(revision 9802)
@@ -34,9 +34,4 @@
                   'coursetickets', 'studentpayments')
 
-def ident(x):
-    return x
-    #for item in x:
-    #    yield item
-
 def get_students(site, stud_filter=StudentsQuery()):
     """Get all students registered in catalog in `site`.
@@ -96,5 +91,5 @@
 
     def filter_func(self, x):
-        return get_students(x)
+        return x
 
     def get_filtered(self, site, **kw):
@@ -131,8 +126,17 @@
         If `filepath` is ``None``, a raw string with CSV data is returned.
         """
-        return self.export(self.filter_func(site), filepath)
+        return self.export(self.filter_func(get_students(site)), filepath)
 
     def export_student(self, student, filepath=None):
         return self.export(self.filter_func([student]), filepath=filepath)
+
+    def export_filtered(self, site, filepath=None, **kw):
+        """Export items denoted by `kw`.
+
+        If `filepath` is ``None``, a raw string with CSV data should
+        be returned.
+        """
+        data = self.get_filtered(site, **kw)
+        return self.export(self.filter_func(data), filepath=filepath)
 
 
@@ -162,13 +166,4 @@
             value, name, context=context)
 
-    def export_all(self, site, filepath=None):
-        """Export students into filepath as CSV data.
-
-        If `filepath` is ``None``, a raw string with CSV data is returned.
-        """
-        return self.export(get_students(site), filepath)
-
-    def export_student(self, student, filepath=None):
-        return self.export([student], filepath=filepath)
 
 class StudentStudyCourseExporter(grok.GlobalUtility, StudentExporterBase):
@@ -199,25 +194,4 @@
             value, name, context=context)
 
-    def export_all(self, site, filepath=None):
-        """Export study courses into filepath as CSV data.
-
-        If `filepath` is ``None``, a raw string with CSV data is returned.
-        """
-        return self.export(get_studycourses(get_students(site)), filepath)
-
-    def export_student(self, student, filepath=None):
-        """Export studycourse of a single student object.
-        """
-        return self.export(get_studycourses([student]), filepath)
-
-    def export_filtered(self, site, filepath=None, **kw):
-        """Export items denoted by `args` and `kw`.
-
-        If `filepath` is ``None``, a raw string with CSV data should
-        be returned.
-        """
-        data = self.get_filtered(site, **kw)
-        return self.export(get_studycourses(data), filepath=filepath)
-
 
 class StudentStudyLevelExporter(grok.GlobalUtility, StudentExporterBase):
@@ -234,4 +208,7 @@
     title = _(u'Student Study Levels')
 
+    def filter_func(self, x):
+        return get_levels(x)
+
     def mangle_value(self, value, name, context=None):
         """Treat location values special.
@@ -243,23 +220,4 @@
             StudentStudyLevelExporter, self).mangle_value(
             value, name, context=context)
-
-    def export_all(self, site, filepath=None):
-        """Export study levels into filepath as CSV data.
-
-        If `filepath` is ``None``, a raw string with CSV data is returned.
-        """
-        return self.export(get_levels(get_students(site)), filepath)
-
-    def export_student(self, student, filepath=None):
-        return self.export(get_levels([student]), filepath)
-
-    def export_filtered(self, site, filepath=None, **kw):
-        """Export items denoted by `args` and `kw`.
-
-        If `filepath` is ``None``, a raw string with CSV data should
-        be returned.
-        """
-        data = self.get_filtered(site, **kw)
-        return self.export(get_levels(data), filepath=filepath)
 
 class CourseTicketExporter(grok.GlobalUtility, StudentExporterBase):
@@ -274,4 +232,7 @@
     #: The title under which this exporter will be displayed
     title = _(u'Course Tickets')
+
+    def filter_func(self, x):
+        return get_tickets(x)
 
     def mangle_value(self, value, name, context=None):
@@ -288,23 +249,4 @@
             value, name, context=context)
 
-    def export_all(self, site, filepath=None):
-        """Export course tickets into filepath as CSV data.
-
-        If `filepath` is ``None``, a raw string with CSV data is returned.
-        """
-        return self.export(get_tickets(get_students(site)), filepath)
-
-    def export_student(self, student, filepath=None):
-        return self.export(get_tickets([student]), filepath)
-
-    def export_filtered(self, site, filepath=None, **kw):
-        """Export items denoted by `args` and `kw`.
-
-        If `filepath` is ``None``, a raw string with CSV data should
-        be returned.
-        """
-        data = self.get_filtered(site, **kw)
-        return self.export(get_tickets(data), filepath=filepath)
-
 
 class PaymentsExporter(grok.GlobalUtility, StudentExporterBase):
@@ -322,4 +264,7 @@
     title = _(u'Student Payments')
 
+    def filter_func(self, x):
+        return get_payments(x)
+
     def mangle_value(self, value, name, context=None):
         """Treat location values special.
@@ -332,23 +277,4 @@
             PaymentsExporter, self).mangle_value(
             value, name, context=context)
-
-    def export_all(self, site, filepath=None):
-        """Export payments into filepath as CSV data.
-
-        If `filepath` is ``None``, a raw string with CSV data is returned.
-        """
-        return self.export(get_payments(get_students(site)), filepath)
-
-    def export_student(self, student, filepath=None):
-        return self.export(get_payments([student]), filepath)
-
-    def export_filtered(self, site, filepath=None, **kw):
-        """Export items denoted by `args` and `kw`.
-
-        If `filepath` is ``None``, a raw string with CSV data should
-        be returned.
-        """
-        data = self.get_filtered(site, **kw)
-        return self.export(get_payments(data), filepath=filepath)
 
 class BedTicketsExporter(grok.GlobalUtility, StudentExporterBase):
@@ -365,4 +291,7 @@
     #: The title under which this exporter will be displayed
     title = _(u'Bed Tickets')
+
+    def filter_func(self, x):
+        return get_bedtickets(x)
 
     def mangle_value(self, value, name, context=None):
@@ -380,23 +309,4 @@
             BedTicketsExporter, self).mangle_value(
             value, name, context=context)
-
-    def export_all(self, site, filepath=None):
-        """Export payments into filepath as CSV data.
-
-        If `filepath` is ``None``, a raw string with CSV data is returned.
-        """
-        return self.export(get_bedtickets(get_students(site)), filepath)
-
-    def export_student(self, student, filepath=None):
-        return self.export(get_bedtickets([student]), filepath)
-
-    def export_filtered(self, site, filepath=None, **kw):
-        """Export items denoted by `args` and `kw`.
-
-        If `filepath` is ``None``, a raw string with CSV data should
-        be returned.
-        """
-        data = self.get_filtered(site, **kw)
-        return self.export(get_bedtickets(data), filepath=filepath)
 
 class StudentPaymentsOverviewExporter(StudentsExporter):
