Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c50fc3e0
authored
Jul 23, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: fix host update
parent
a017e6cf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
network/forms.py
+1
-0
network/views.py
+7
-0
No files found.
network/forms.py
View file @
c50fc3e0
...
...
@@ -50,6 +50,7 @@ class HostForm(ModelForm):
'description'
,
'location'
,
'comment'
,
'owner'
,
# 'created_at',
# 'modified_at',
# 'id'
...
...
network/views.py
View file @
c50fc3e0
from
django.views.generic
import
TemplateView
from
django.views.generic
import
UpdateView
from
django.core.urlresolvers
import
reverse_lazy
from
django_tables2
import
SingleTableView
...
...
@@ -23,6 +24,10 @@ class HostDetail(UpdateView):
template_name
=
"network/host-edit.html"
form_class
=
HostForm
def
get_success_url
(
self
):
if
'pk'
in
self
.
kwargs
:
return
reverse_lazy
(
'network.host'
,
kwargs
=
self
.
kwargs
)
class
VlanList
(
SingleTableView
):
model
=
Vlan
...
...
@@ -40,3 +45,5 @@ class VlanDetail(UpdateView):
q
=
Host
.
objects
.
filter
(
vlan
=
self
.
object
)
.
all
()
context
[
'host_list'
]
=
SmallHostTable
(
q
)
return
context
success_url
=
reverse_lazy
(
'network.vlan_list'
)
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