Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
14348bfb
authored
May 28, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: create new domain
parent
73000026
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
14 deletions
+27
-14
firewall_gui/views.py
+27
-14
No files found.
firewall_gui/views.py
View file @
14348bfb
...
@@ -524,20 +524,33 @@ def show_record(request, id=None):
...
@@ -524,20 +524,33 @@ def show_record(request, id=None):
}
}
return
HttpResponse
(
json
.
dumps
(
record
),
content_type
=
'application/json'
)
return
HttpResponse
(
json
.
dumps
(
record
),
content_type
=
'application/json'
)
def
show_domain
(
request
,
id
):
def
show_domain
(
request
,
id
=
None
):
domain
=
get_object_or_404
(
Domain
,
id
=
id
)
try
:
domain
=
{
domain
=
Domain
.
objects
.
get
(
id
=
id
)
'id'
:
domain
.
id
,
domain
=
{
'name'
:
domain
.
name
,
'id'
:
domain
.
id
,
'owner'
:
{
'name'
:
domain
.
name
,
'id'
:
domain
.
owner
.
id
,
'owner'
:
{
'name'
:
domain
.
owner
.
username
,
'id'
:
domain
.
owner
.
id
,
},
'name'
:
domain
.
owner
.
username
,
'created_at'
:
domain
.
created_at
.
isoformat
(),
},
'modified_at'
:
domain
.
modified_at
.
isoformat
(),
'created_at'
:
domain
.
created_at
.
isoformat
(),
'ttl'
:
domain
.
ttl
,
'modified_at'
:
domain
.
modified_at
.
isoformat
(),
'description'
:
domain
.
description
'ttl'
:
domain
.
ttl
,
}
'description'
:
domain
.
description
}
except
:
domain
=
{
'id'
:
None
,
'name'
:
None
,
'owner'
:
{
'name'
:
None
,
},
'created_at'
:
None
,
'modified_at'
:
None
,
'ttl'
:
None
,
'description'
:
''
}
return
HttpResponse
(
json
.
dumps
(
domain
),
content_type
=
'application/json'
)
return
HttpResponse
(
json
.
dumps
(
domain
),
content_type
=
'application/json'
)
def
make_autocomplete
(
entity
,
name
=
'name'
):
def
make_autocomplete
(
entity
,
name
=
'name'
):
...
...
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