Index: main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/export.py	(revision 8492)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/export.py	(revision 8493)
@@ -103,8 +103,17 @@
 
     #: Fieldnames considered by this exporter
-    fields = tuple(sorted(iface_names(IStudent, omit=['loggerInfo'])))
+    fields = tuple(sorted(iface_names(
+        IStudent, omit=['loggerInfo']))) + (
+        'password', 'state', 'history', 'certcode')
 
     #: The title under which this exporter will be displayed
     title = _(u'Students')
+
+    def mangle_value(self, value, name, context=None):
+        if name == 'history':
+            value = value.messages
+        return super(
+            StudentsExporter, self).mangle_value(
+            value, name, context=context)
 
     def export_all(self, site, filepath=None):
@@ -125,5 +134,5 @@
 
     #: Fieldnames considered by this exporter
-    fields = tuple(sorted(iface_names(IStudentStudyCourse)))
+    fields = tuple(sorted(iface_names(IStudentStudyCourse))) + ('student_id',)
 
     #: The title under which this exporter will be displayed
@@ -131,12 +140,12 @@
 
     def mangle_value(self, value, name, context=None):
-        """Add the hash symbol at the end of date_of_birth.
-
-        This is to avoid annoying automatic date transformation
-        by Excel or Calc.
+        """Treat location values special.
         """
         if name == 'certificate' and value is not None:
             # XXX: hopefully cert codes are unique site-wide
             value = value.code
+        if name == 'student_id' and context is not None:
+            student = context.getStudent()
+            value = getattr(student, name, None)
         return super(
             StudentStudyCourseExporter, self).mangle_value(
@@ -162,6 +171,6 @@
 
     #: Fieldnames considered by this exporter
-    fields = tuple(sorted(iface_names(IStudentStudyLevel) + [
-        'reg_number', 'matric_number', 'level']))
+    fields = tuple(sorted(iface_names(
+        IStudentStudyLevel) + ['level'])) + ('student_id',)
 
     #: The title under which this exporter will be displayed
@@ -169,18 +178,9 @@
 
     def mangle_value(self, value, name, context=None):
-        """Add the hash symbol at the end of date_of_birth.
-
-        This is to avoid annoying automatic date transformation
-        by Excel or Calc.
-        """
-
-        if name == 'reg_number' and context is not None:
-            value = getattr(
-                getattr(getattr(context, '__parent__', None),
-                        '__parent__', None), 'reg_number', None)
-        if name == 'matric_number' and context is not None:
-            value = getattr(
-                getattr(getattr(context, '__parent__', None),
-                        '__parent__', None), 'matric_number', None)
+        """Treat location values special.
+        """
+        if name == 'student_id' and context is not None:
+            student = context.getStudent()
+            value = getattr(student, name, None)
         return super(
             StudentStudyLevelExporter, self).mangle_value(
@@ -203,7 +203,7 @@
 
     #: Fieldnames considered by this exporter
-    fields = tuple(sorted(iface_names(ICourseTicket) + [
-        'reg_number', 'matric_number', 'level', 'code', 'title', 'credits',
-        'passmark', 'semester', 'fcode', 'dcode']))
+    fields = tuple(sorted(iface_names(ICourseTicket) +
+        ['level', 'code', 'title', 'credits',
+        'passmark', 'semester', 'fcode', 'dcode'])) + ('student_id',)
 
     #: The title under which this exporter will be displayed
@@ -215,5 +215,5 @@
         if context is not None:
             student = context.getStudent()
-            if name in ['reg_number', 'matric_number'] and student is not None:
+            if name == 'student_id' and student is not None:
                 value = getattr(student, name, None)
             if name == 'level':
@@ -241,6 +241,6 @@
     #: Fieldnames considered by this exporter
     fields = tuple(
-        sorted(['reg_number', 'matric_number'] +
-               iface_names(IStudentOnlinePayment, exclude_attribs=False)))
+        sorted(iface_names(
+            IStudentOnlinePayment, exclude_attribs=False))) + ('student_id',)
 
     #: The title under which this exporter will be displayed
@@ -252,5 +252,5 @@
         if context is not None:
             student = context.getStudent()
-            if name in ['reg_number', 'matric_number'] and student is not None:
+            if name in ['student_id'] and student is not None:
                 value = getattr(student, name, None)
         return super(
