]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/node.py
Some small tweaks.
[osqa.git] / forum / models / node.py
index f62a8e078b9c2fc17b8a80d6a39cc9617df6c9ff..36fbda9d9be9eef4162562b913735434311b80b0 100644 (file)
@@ -247,7 +247,7 @@ class Node(BaseModel, NodeContent):
     @classmethod
     def _generate_cache_key(cls, key, group="node"):
         return super(Node, cls)._generate_cache_key(key, group)
-
+        
     @classmethod
     def get_type(cls):
         return cls.__name__.lower()
@@ -283,6 +283,13 @@ class Node(BaseModel, NodeContent):
 
         return nis
 
+    @property
+    def last_activity(self):
+        try:
+            return self.actions.order_by('-action_date')[0].action_date
+        except:
+            return self.last_seen
+
     @property
     def state_list(self):
         return [s.state_type for s in self.states.all()]