Commit 376b5101 authored by Skia's avatar Skia

Add docstring to PageRev

parent 268a3325
......@@ -347,6 +347,13 @@ class Page(models.Model):
return self.get_full_name()
class PageRev(models.Model):
"""
This is the true content of the page.
Each page object has a revisions field that is a list of PageRev, ordered by date.
my_page.revisions.last() gives the PageRev object that is the most up-to-date, and thus,
is the real content of the page.
The content is in PageRev.title and PageRev.content .
"""
title = models.CharField(_("page title"), max_length=255, blank=True)
content = models.TextField(_("page content"), blank=True)
date = models.DateTimeField(_('date'), auto_now=True)
......
......@@ -111,7 +111,7 @@ class PageEditView(CanEditMixin, UpdateView):
self.page.set_lock(self.request.user)
except LockError as e:
raise e
return self.page.revisions.all().last()
return self.page.revisions.last()
return None
def get_context_data(self, **kwargs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment