Index: /main/waeup.kofa/trunk/src/waeup/kofa/mandates/interfaces.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/mandates/interfaces.py	(revision 8848)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/mandates/interfaces.py	(revision 8849)
@@ -34,5 +34,5 @@
 
 class IMandate(IKofaObject):
-    """A base representation of mandates.
+    """A representation of all mandates.
 
     """
@@ -40,3 +40,6 @@
     expires = Attribute('Expiration Datetime')
     params = Attribute('Dictionary with mandate parameters')
-    category = Attribute('Mandate Category')
+
+    def execute():
+        """Method which is performed by the mandate.
+        """
Index: /main/waeup.kofa/trunk/src/waeup/kofa/mandates/mandate.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/mandates/mandate.py	(revision 8848)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/mandates/mandate.py	(revision 8849)
@@ -21,6 +21,6 @@
 import grok
 import hashlib
+import os
 from datetime import datetime, timedelta
-from time import time
 from grok import index
 from waeup.kofa.interfaces import IUserAccount
@@ -28,11 +28,12 @@
 from waeup.kofa.mandates.interfaces import IMandate
 
-class Mandate(grok.Container):
-    """This is a mandate which can set a student password.
+class Mandate(grok.Model):
+    """This is a mandate.
     """
     grok.implements(IMandate)
     grok.provides(IMandate)
+    grok.baseclass()
 
-    def __init__(self, days=1, category=None, mandate_id=None):
+    def __init__(self, days=1, mandate_id=None):
         super(Mandate, self).__init__()
         self.creation_date = datetime.utcnow() # offset-naive datetime
@@ -40,10 +41,16 @@
         self.expires = datetime.utcnow() + delta
         if mandate_id is None:
-            timestamp = "%d" % int(time()*1000)
-            mandate_id = hashlib.md5(timestamp).hexdigest()
+            mandate_id = os.urandom(20)
+            mandate_id = hashlib.md5(mandate_id).hexdigest()
         self.mandate_id = mandate_id
-        self.category = category
         self.params = {}
         return
+
+    def execute(self):
+        return _('Nothing to do.')
+
+class StudentPasswordMandate(Mandate):
+    """This is a mandate which can set a student password.
+    """
 
     def _setStudentPassword(self):
@@ -60,7 +67,6 @@
         if self.expires < datetime.utcnow():
             msg = _('Mandate expired.')
-        elif self.category == 'student_password':
-            if self._setStudentPassword():
-                msg = _('Password has been successfully set.')
+        if self._setStudentPassword():
+            msg = _('Password has been successfully set.')
         del self.__parent__[self.mandate_id]
         return msg
Index: /main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py	(revision 8848)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py	(revision 8849)
@@ -31,5 +31,5 @@
     IMandatesContainer, IMandate)
 from waeup.kofa.mandates.container import MandatesContainer
-from waeup.kofa.mandates.mandate import Mandate
+from waeup.kofa.mandates.mandate import StudentPasswordMandate
 from waeup.kofa.testing import (FunctionalLayer, FunctionalTestCase)
 
@@ -50,9 +50,9 @@
         self.assertTrue(
             verifyClass(
-                IMandate, Mandate)
+                IMandate, StudentPasswordMandate)
             )
         self.assertTrue(
             verifyObject(
-                IMandate, Mandate())
+                IMandate, StudentPasswordMandate())
             )
         return
@@ -88,5 +88,5 @@
         self.app['students'].addStudent(student)
         # Add and execute a mandate with missing parameters.
-        mandate = Mandate()
+        mandate = StudentPasswordMandate()
         mandate.category = 'student_password'
         self.app['mandates'].addMandate(mandate)
@@ -94,5 +94,5 @@
         self.assertEqual(msg, u'Wrong mandate parameters.')
         # Add and execute an expired mandate.
-        mandate = Mandate(days=0)
+        mandate = StudentPasswordMandate(days=0)
         mandate.category = 'student_password'
         self.app['mandates'].addMandate(mandate)
@@ -100,5 +100,5 @@
         self.assertEqual(msg, u'Mandate expired.')
         # Add and execute a perfect mandate
-        mandate = Mandate()
+        mandate = StudentPasswordMandate()
         mandate.category = 'student_password'
         mandate.params['student_id'] = student.student_id
@@ -114,8 +114,8 @@
     def test_remove_expired(self):
         # mandate1 is an old mandate which just expired.
-        mandate1 = Mandate(days=0)
+        mandate1 = StudentPasswordMandate(days=0)
         self.app['mandates'].addMandate(mandate1)
         # mandate2 is a new mandate with default time delta.
-        mandate2 = Mandate(mandate_id='23456')
+        mandate2 = StudentPasswordMandate(mandate_id='23456')
         self.app['mandates'].addMandate(mandate2)
         self.assertEqual(len(self.app['mandates'].keys()), 2)
@@ -128,5 +128,5 @@
         student = createObject('waeup.Student')
         self.app['students'].addStudent(student)
-        mandate = Mandate()
+        mandate = StudentPasswordMandate()
         mandate.category = 'student_password'
         mandate.params['student_id'] = student.student_id
