Commit 692cbe84 by Bence Dányi

firewall_gui: show domain details

parent 51b375a9
......@@ -100,6 +100,8 @@ urlpatterns = patterns('',
url(r'^firewall/vlans/(?P<id>\d+)/$', 'firewall_gui.views.show_vlan'),
url(r'^firewall/vlangroups/(?P<id>\d+)/$', 'firewall_gui.views.show_vlangroup'),
url(r'^firewall/hostgroups/(?P<id>\d+)/$', 'firewall_gui.views.show_hostgroup'),
url(r'^firewall/records/(?P<id>\d+)/$', 'firewall_gui.views.show_record'),
url(r'^firewall/domains/(?P<id>\d+)/$', 'firewall_gui.views.show_domain'),
url(r'^firewall/(?P<name>\w+)/$', 'firewall_gui.views.list_entities'),
......
......@@ -396,6 +396,21 @@ def show_record(request, id):
}
return HttpResponse(json.dumps(record), content_type='application/json')
def show_domain(request, id):
domain = get_object_or_404(Domain, id=id)
domain = {
'id': domain.id,
'name': domain.name,
'owner': {
'id': domain.owner.id,
'name': domain.owner.username,
},
'created_at': domain.created_at.isoformat(),
'modified_at': domain.modified_at.isoformat(),
'ttl': domain.ttl,
'description': domain.description
}
return HttpResponse(json.dumps(domain), content_type='application/json')
def make_autocomplete(entity, name='name'):
def autocomplete(request):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment