mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 07:41:14 +00:00
Add docstring to PageRev
This commit is contained in:
parent
268a33255b
commit
376b5101c1
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user