Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Sith
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
59
Issues
59
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AE
Sith
Commits
376b5101
Commit
376b5101
authored
Dec 09, 2015
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docstring to PageRev
parent
268a3325
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
core/models.py
core/models.py
+7
-0
core/views/page.py
core/views/page.py
+1
-1
No files found.
core/models.py
View file @
376b5101
...
...
@@ -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
)
...
...
core/views/page.py
View file @
376b5101
...
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment