Index: /main/waeup.sirp/trunk/src/waeup/sirp/university/export.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/university/export.py	(revision 7731)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/university/export.py	(revision 7732)
@@ -10,5 +10,5 @@
     """
     grok.implements(ICSVExporter)
-    grok.name('Faculty Exporter')
+    grok.name('faculties')
 
     #: Fieldnames considered by this exporter
@@ -66,11 +66,12 @@
         return
 
-    def export(self, faculty, filepath=None):
-        """Export single `faculty` as CSV file.
+    def export(self, faculties, filepath=None):
+        """Export `faculties`, an iterable, as CSV file.
 
         If `filepath` is ``None``, a raw string with CSV data is returned.
         """
         writer, outfile = self.get_csv_writer(filepath)
-        self.write_item(faculty, writer)
+        for faculty in faculties:
+            self.write_item(faculty, writer)
         return self.close_outfile(filepath, outfile)
 
@@ -82,5 +83,37 @@
         writer, outfile = self.get_csv_writer(filepath)
         faculties = site.get('faculties', {})
+        return self.export(faculties.values(), filepath)
         for faculty in faculties.values():
             self.write_item(faculty, writer)
         return self.close_outfile(filepath, outfile)
+
+class DepartmentExporter(FacultyExporter, grok.GlobalUtility):
+    """Exporter for departments.
+    """
+    grok.implements(ICSVExporter)
+    grok.name('departments')
+
+    #: Fieldnames considered by this exporter
+    fields = ('code', 'faculty', 'title', 'title_prefix')
+
+    def mangle_value(self, value, name, context=None):
+        """Hook for mangling values in derived classes
+        """
+        if name == 'faculty':
+            value = getattr(
+                getattr(context, '__parent__', None),
+                'code', None)
+        return super(DepartmentExporter, self).mangle_value(
+            value, name, context)
+
+    def export_all(self, site, filepath=None):
+        """Export faculties in facultycontainer into filepath as CSV data.
+
+        If `filepath` is ``None``, a raw string with CSV data is returned.
+        """
+        writer, outfile = self.get_csv_writer(filepath)
+        faculties = site.get('faculties', {})
+        for faculty in faculties.values():
+            for department in faculty.values():
+                self.write_item(department, writer)
+        return self.close_outfile(filepath, outfile)
