]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/page.py
Fixes some weird threading problems with modules.
[osqa.git] / forum / models / page.py
index ff3b1a4e7ac925217865eaff4ca9cc481bfc3632..665a1be837ac395d2c1323f1487d0986b14e2b45 100644 (file)
@@ -8,6 +8,10 @@ class Page(Node):
     def published(self):
         return self.marked
 
+    @property
+    def html(self):
+        return self._as_markdown(self.body)
+
     def save(self, *args, **kwargs):
         old_options = self._original_state.get('extra', None)
 
@@ -33,8 +37,18 @@ class Page(Node):
     @models.permalink
     def get_absolute_url(self):
         return ('static_page', (), {'path': self.extra['path']})
+        
+    def activate_revision(self, user, revision, extensions=['urlize']):
+        self.title = revision.title
+        self.tagnames = revision.tagnames        
+        self.body = revision.body
+
+        self.active_revision = revision
+        self.update_last_activity(user)
+
+        self.save()
 
     class Meta(Node.Meta):
         proxy = True
 
-    
\ No newline at end of file
+