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
a24d2c26
Commit
a24d2c26
authored
Jan 06, 2018
by
LEVY-FALK Hugo
Committed by
root
Jan 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Discrimination de l'historique par application.
parent
783c662e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
36 deletions
+51
-36
cotisations/urls.py
cotisations/urls.py
+1
-0
machines/urls.py
machines/urls.py
+1
-0
preferences/urls.py
preferences/urls.py
+2
-1
re2o/views.py
re2o/views.py
+43
-33
topologie/urls.py
topologie/urls.py
+2
-1
users/urls.py
users/urls.py
+2
-1
No files found.
cotisations/urls.py
View file @
a24d2c26
...
@@ -104,6 +104,7 @@ urlpatterns = [
...
@@ -104,6 +104,7 @@ urlpatterns = [
r
'history/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$'
,
r
'history/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$'
,
re2o
.
views
.
history
,
re2o
.
views
.
history
,
name
=
'history'
,
name
=
'history'
,
kwargs
=
{
'application'
:
'cotisations'
},
),
),
url
(
r
'^control/$'
,
url
(
r
'^control/$'
,
views
.
control
,
views
.
control
,
...
...
machines/urls.py
View file @
a24d2c26
...
@@ -80,6 +80,7 @@ urlpatterns = [
...
@@ -80,6 +80,7 @@ urlpatterns = [
r
'history/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$'
,
r
'history/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$'
,
re2o
.
views
.
history
,
re2o
.
views
.
history
,
name
=
'history'
,
name
=
'history'
,
kwargs
=
{
'application'
:
'machines'
},
),
),
url
(
r
'^$'
,
views
.
index
,
name
=
'index'
),
url
(
r
'^$'
,
views
.
index
,
name
=
'index'
),
url
(
r
'^rest/mac-ip/$'
,
views
.
mac_ip
,
name
=
'mac-ip'
),
url
(
r
'^rest/mac-ip/$'
,
views
.
mac_ip
,
name
=
'mac-ip'
),
...
...
preferences/urls.py
View file @
a24d2c26
...
@@ -72,7 +72,8 @@ urlpatterns = [
...
@@ -72,7 +72,8 @@ urlpatterns = [
url
(
url
(
r
'^history/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$'
,
r
'^history/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$'
,
re2o
.
views
.
history
,
re2o
.
views
.
history
,
name
=
'history'
name
=
'history'
,
kwargs
=
{
'application'
:
'preferences'
},
),
),
url
(
r
'^$'
,
views
.
display_options
,
name
=
'display-options'
),
url
(
r
'^$'
,
views
.
display_options
,
name
=
'display-options'
),
]
]
re2o/views.py
View file @
a24d2c26
...
@@ -54,41 +54,51 @@ def index(request):
...
@@ -54,41 +54,51 @@ def index(request):
#: Binding the corresponding char sequence of history url to re2o models.
#: Binding the corresponding char sequence of history url to re2o models.
HISTORY_BIND
=
{
HISTORY_BIND
=
{
'user'
:
users
.
models
.
User
,
'users'
:
{
'ban'
:
users
.
models
.
Ban
,
'user'
:
users
.
models
.
User
,
'whitelist'
:
users
.
models
.
Whitelist
,
'ban'
:
users
.
models
.
Ban
,
'school'
:
users
.
models
.
School
,
'whitelist'
:
users
.
models
.
Whitelist
,
'listright'
:
users
.
models
.
ListRight
,
'school'
:
users
.
models
.
School
,
'serviceuser'
:
users
.
models
.
ServiceUser
,
'listright'
:
users
.
models
.
ListRight
,
'service'
:
preferences
.
models
.
Service
,
'serviceuser'
:
users
.
models
.
ServiceUser
,
'facture'
:
cotisations
.
models
.
Facture
,
},
'article'
:
cotisations
.
models
.
Article
,
'preferences'
:
{
'paiement'
:
cotisations
.
models
.
Paiement
,
'service'
:
preferences
.
models
.
Service
,
'banque'
:
cotisations
.
models
.
Banque
,
},
'switch'
:
topologie
.
models
.
Switch
,
'cotisations'
:
{
'port'
:
topologie
.
models
.
Port
,
'facture'
:
cotisations
.
models
.
Facture
,
'room'
:
topologie
.
models
.
Room
,
'article'
:
cotisations
.
models
.
Article
,
'stack'
:
topologie
.
models
.
Stack
,
'paiement'
:
cotisations
.
models
.
Paiement
,
'model_switch'
:
topologie
.
models
.
ModelSwitch
,
'banque'
:
cotisations
.
models
.
Banque
,
'constructor_switch'
:
topologie
.
models
.
ConstructorSwitch
,
},
'machine'
:
machines
.
models
.
Machine
,
'topologie'
:
{
'interface'
:
machines
.
models
.
Interface
,
'switch'
:
topologie
.
models
.
Switch
,
'alias'
:
machines
.
models
.
Domain
,
'port'
:
topologie
.
models
.
Port
,
'machinetype'
:
machines
.
models
.
MachineType
,
'room'
:
topologie
.
models
.
Room
,
'iptype'
:
machines
.
models
.
IpType
,
'stack'
:
topologie
.
models
.
Stack
,
'extension'
:
machines
.
models
.
Extension
,
'model_switch'
:
topologie
.
models
.
ModelSwitch
,
'soa'
:
machines
.
models
.
SOA
,
'constructor_switch'
:
topologie
.
models
.
ConstructorSwitch
,
'mx'
:
machines
.
models
.
Mx
,
},
'txt'
:
machines
.
models
.
Txt
,
'machines'
:
{
'srv'
:
machines
.
models
.
Srv
,
'machine'
:
machines
.
models
.
Machine
,
'ns'
:
machines
.
models
.
Ns
,
'interface'
:
machines
.
models
.
Interface
,
'service'
:
machines
.
models
.
Service
,
'alias'
:
machines
.
models
.
Domain
,
'vlan'
:
machines
.
models
.
Vlan
,
'machinetype'
:
machines
.
models
.
MachineType
,
'nas'
:
machines
.
models
.
Vlan
,
'iptype'
:
machines
.
models
.
IpType
,
'extension'
:
machines
.
models
.
Extension
,
'soa'
:
machines
.
models
.
SOA
,
'mx'
:
machines
.
models
.
Mx
,
'txt'
:
machines
.
models
.
Txt
,
'srv'
:
machines
.
models
.
Srv
,
'ns'
:
machines
.
models
.
Ns
,
'service'
:
machines
.
models
.
Service
,
'vlan'
:
machines
.
models
.
Vlan
,
'nas'
:
machines
.
models
.
Vlan
,
},
}
}
@
login_required
@
login_required
def
history
(
request
,
object_name
,
object_id
):
def
history
(
request
,
application
,
object_name
,
object_id
):
"""Render history for a model.
"""Render history for a model.
The model is determined using the `HISTORY_BIND` dictionnary if none is
The model is determined using the `HISTORY_BIND` dictionnary if none is
...
@@ -108,7 +118,7 @@ def history(request, object_name, object_id):
...
@@ -108,7 +118,7 @@ def history(request, object_name, object_id):
Http404: This kind of models doesn't have history.
Http404: This kind of models doesn't have history.
"""
"""
try
:
try
:
model
=
HISTORY_BIND
[
object_name
]
model
=
HISTORY_BIND
[
application
][
object_name
]
except
KeyError
as
e
:
except
KeyError
as
e
:
raise
Http404
(
u
"Il n'existe pas d'historique pour ce modèle."
)
raise
Http404
(
u
"Il n'existe pas d'historique pour ce modèle."
)
try
:
try
:
...
...
topologie/urls.py
View file @
a24d2c26
...
@@ -49,7 +49,8 @@ urlpatterns = [
...
@@ -49,7 +49,8 @@ urlpatterns = [
url
(
url
(
r
'^history/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$'
,
r
'^history/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$'
,
re2o
.
views
.
history
,
re2o
.
views
.
history
,
name
=
'history'
name
=
'history'
,
kwargs
=
{
'application'
:
'topologie'
},
),
),
url
(
r
'^edit_port/(?P<port_id>[0-9]+)$'
,
views
.
edit_port
,
name
=
'edit-port'
),
url
(
r
'^edit_port/(?P<port_id>[0-9]+)$'
,
views
.
edit_port
,
name
=
'edit-port'
),
url
(
r
'^new_port/(?P<switch_id>[0-9]+)$'
,
views
.
new_port
,
name
=
'new-port'
),
url
(
r
'^new_port/(?P<switch_id>[0-9]+)$'
,
views
.
new_port
,
name
=
'new-port'
),
...
...
users/urls.py
View file @
a24d2c26
...
@@ -97,7 +97,8 @@ urlpatterns = [
...
@@ -97,7 +97,8 @@ urlpatterns = [
url
(
url
(
r
'^history/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$'
,
r
'^history/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$'
,
re2o
.
views
.
history
,
re2o
.
views
.
history
,
name
=
'history'
name
=
'history'
,
kwargs
=
{
'application'
:
'users'
},
),
),
url
(
r
'^$'
,
views
.
index
,
name
=
'index'
),
url
(
r
'^$'
,
views
.
index
,
name
=
'index'
),
url
(
r
'^index_clubs/$'
,
views
.
index_clubs
,
name
=
'index-clubs'
),
url
(
r
'^index_clubs/$'
,
views
.
index_clubs
,
name
=
'index-clubs'
),
...
...
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