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
R
re2o
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
a1df6136
Commit
a1df6136
authored
Dec 28, 2017
by
LEVY-FALK Hugo
Committed by
root
Jan 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation de history.
parent
41ba73ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
re2o/views.py
re2o/views.py
+19
-2
No files found.
re2o/views.py
View file @
a1df6136
...
...
@@ -51,7 +51,7 @@ def index(request):
services
[
indice
%
3
].
append
(
serv
)
return
form
({
'services_urls'
:
services
},
're2o/index.html'
,
request
)
#: Binding the corresponding char sequence of history url to re2o models.
HISTORY_BIND
=
{
'user'
:
users
.
models
.
User
,
'ban'
:
users
.
models
.
Ban
,
...
...
@@ -88,7 +88,24 @@ HISTORY_BIND = {
@
login_required
def
history
(
request
,
object_name
,
object_id
):
""" Affichage de l'historique"""
"""Render history for a model.
The model is determined using the `HISTORY_BIND` dictionnary if none is
found, raises a Http404. The view checks if the user is allowed to see the
history using the `can_view` method of the model.
Args:
request: The request sent by the user.
object_name: Name of the model.
object_id: Id of the object you want to acces history.
Returns:
The rendered page of history if access is granted, else the user is
redirected to their profile page, with an error message.
Raises:
Http404: This kind of models doesn't have history.
"""
try
:
model
=
HISTORY_BIND
[
object_name
]
except
KeyError
as
e
:
...
...
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