revert accidental (too early) checkin
[plcapi.git] / PLC / Nodes.py
index f83c740..78bbfdc 100644 (file)
@@ -4,7 +4,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: Nodes.py,v 1.25 2006/11/28 10:25:03 thierry Exp $
+# $Id: Nodes.py,v 1.28 2006/12/05 16:45:03 thierry Exp $
 #
 
 from types import StringTypes
@@ -64,7 +64,10 @@ class Node(Row):
 
     # for Cache
     class_key = 'hostname'
-    foreign_fields = ['boot_state','model','version','date_created','last_updated']
+    foreign_fields = ['boot_state','model','version']
+    # forget about these ones, they are read-only anyway
+    # handling them causes Cache to re-sync all over again 
+    # 'date_created','last_updated'
     foreign_xrefs = [
        # in this case, we dont need the 'table' but Cache will look it up, so...
         {'field' : 'site_id' , 'class' : 'Site' , 'table' : 'unused-on-direct-refs' } ,
@@ -88,6 +91,12 @@ class Node(Row):
 
         return boot_state
 
+    # timestamps
+    def validate_date_created (self, timestamp):
+       return self.validate_timestamp (timestamp)
+    def validate_last_updated (self, timestamp):
+       return self.validate_timestamp (timestamp)
+
     def delete(self, commit = True):
         """
         Delete existing node.