- add Session support
[plcapi.git] / PLC / Persons.py
index 513afcf..9f7c1fc 100644 (file)
@@ -4,7 +4,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: Persons.py,v 1.10 2006/10/10 21:51:35 mlhuang Exp $
+# $Id: Persons.py,v 1.14 2006/10/25 14:29:13 mlhuang Exp $
 #
 
 from types import StringTypes
@@ -42,8 +42,8 @@ class Person(Row):
         'bio': Parameter(str, "Biography", max = 254),
         'enabled': Parameter(bool, "Has been enabled"),
         'password': Parameter(str, "Account password in crypt() form", max = 254),
-        'last_updated': Parameter(str, "Date and time of last update", ro = True),
-        'date_created': Parameter(str, "Date and time when account was created", ro = True),
+        'last_updated': Parameter(int, "Date and time of last update", ro = True),
+        'date_created': Parameter(int, "Date and time when account was created", ro = True),
         'role_ids': Parameter([int], "List of role identifiers", ro = True),
         'roles': Parameter([str], "List of roles", ro = True),
         'site_ids': Parameter([int], "List of site identifiers", ro = True),
@@ -51,10 +51,6 @@ class Person(Row):
         'slice_ids': Parameter([int], "List of slice identifiers", ro = True),
         }
 
-    def __init__(self, api, fields = {}):
-        Row.__init__(self, fields)
-        self.api = api
-
     def validate_email(self, email):
         """
         Validate email address. Stolen from Mailman.
@@ -279,7 +275,7 @@ class Person(Row):
             key.delete(commit = False)
 
         # Clean up miscellaneous join tables
-        for table in ['person_role', 'person_site', 'slice_person']:
+        for table in ['person_role', 'person_site', 'slice_person', 'person_session']:
             self.api.db.do("DELETE FROM %s" \
                            " WHERE person_id = %d" % \
                            (table, self['person_id']))