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
30140de2
Commit
30140de2
authored
Apr 18, 2018
by
Gabriel Detraz
Committed by
chirac
Apr 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Des methodes raccourci pour mon gentil grizzly
parent
f7b2e22d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
topologie/models.py
topologie/models.py
+17
-0
No files found.
topologie/models.py
View file @
30140de2
...
...
@@ -103,6 +103,23 @@ class AccessPoint(AclMixin, Machine):
(
"view_accesspoint"
,
"Peut voir une borne"
),
)
def
switch
(
self
):
"""Return the switch where this is plugged"""
return
Switch
.
objects
.
filter
(
ports__machine_interface__machine
=
self
)
def
building
(
self
):
"""Return the building of the AP (building of the switchs connected to...)"""
return
Building
.
objects
.
filter
(
switchbay__switch
=
self
.
switch
()
)
@
classmethod
def
all_ap_in
(
cls
,
building_instance
):
"""Get a building as argument, returns all ap of a building"""
return
cls
.
objects
.
filter
(
interface__port__switch__switchbay__building
=
building_instance
)
def
__str__
(
self
):
return
str
(
self
.
interface_set
.
first
())
...
...
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