]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/comment.py
osqa-89:
[osqa.git] / forum / models / comment.py
index 071126e93acdc7247a43bb21adf7d6e50707d1ca..a2e74258e036fc8dfdbb1f321680c982e5eba923 100644 (file)
@@ -15,6 +15,10 @@ class Comment(Node):
     def comment(self):\r
         return self.body\r
 \r
+    @property\r
+    def headline(self):\r
+        return self.absolute_parent.headline\r
+\r
     @property\r
     def content_object(self):\r
         return self.parent.leaf\r
@@ -28,7 +32,7 @@ class Comment(Node):
         try:\r
             ping_google()\r
         except Exception:\r
-            logging.debug('problem pinging google did you register you sitemap with google?')\r
+            logging.debug('problem pinging google did you register your sitemap with google?')\r
 \r
     def mark_deleted(self, user):\r
         if super(Comment, self).mark_deleted(user):\r
@@ -39,12 +43,15 @@ class Comment(Node):
             self._update_parent_comment_count(1)\r
 \r
     def is_reply_to(self, user):\r
-        inreply = re.search('@\w+', self.comment)\r
+        inreply = re.search('@\w+', self.body)\r
         if inreply is not None:\r
             return user.username.startswith(inreply.group(0))\r
 \r
         return False\r
 \r
+    def get_absolute_url(self):\r
+        return self.absolute_parent.get_absolute_url() + "#%d" % self.id\r
+\r
     def __unicode__(self):\r
         return self.body\r
 \r