git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2e7ca3e
)
merge from Trunk
author
Tony Mack
<tmack@cs.princeton.edu>
Mon, 22 Oct 2007 18:50:51 +0000
(18:50 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Mon, 22 Oct 2007 18:50:51 +0000
(18:50 +0000)
PLC/Nodes.py
patch
|
blob
|
history
diff --git
a/PLC/Nodes.py
b/PLC/Nodes.py
index
7b43641
..
1475ca2
100644
(file)
--- a/
PLC/Nodes.py
+++ b/
PLC/Nodes.py
@@
-4,7
+4,7
@@
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id: Nodes.py
,v 1.36 2007/09/12 17:52:27 tmack Exp
$
+# $Id: Nodes.py
800 2007-08-30 03:49:35Z thierry
$
#
from types import StringTypes
#
from types import StringTypes
@@
-111,6
+111,19
@@
class Node(Row):
" where node_id = %d" % ( self['node_id']) )
self.sync(commit)
" where node_id = %d" % ( self['node_id']) )
self.sync(commit)
+
+ def update_last_updated(self, commit = True):
+ """
+ Update last_updated field with current time
+ """
+
+ assert 'node_id' in self
+ assert self.table_name
+
+ self.api.db.do("UPDATE %s SET last_updated = CURRENT_TIMESTAMP " % (self.table_name) + \
+ " where node_id = %d" % (self['node_id']) )
+ self.sync(commit)
+
def delete(self, commit = True):
"""
Delete existing node.
def delete(self, commit = True):
"""
Delete existing node.