Commit 1e7cd0f7 by Őry Máté

network: use vid instead of id for VlanDetail urls

parent ac0e2797
...@@ -37,7 +37,7 @@ class SmallHostTable(Table): ...@@ -37,7 +37,7 @@ class SmallHostTable(Table):
class VlanTable(Table): class VlanTable(Table):
name = LinkColumn('network.vlan', args=[A('pk')]) name = LinkColumn('network.vlan', args=[A('vid')])
class Meta: class Meta:
model = Vlan model = Vlan
......
...@@ -13,5 +13,5 @@ urlpatterns = patterns( ...@@ -13,5 +13,5 @@ urlpatterns = patterns(
url('^hosts/$', HostList.as_view(), name='network.host_list'), url('^hosts/$', HostList.as_view(), name='network.host_list'),
url('^hosts/(?P<pk>\d+)/$', HostDetail.as_view(), name='network.host'), url('^hosts/(?P<pk>\d+)/$', HostDetail.as_view(), name='network.host'),
url('^vlans/$', VlanList.as_view(), name='network.vlan_list'), url('^vlans/$', VlanList.as_view(), name='network.vlan_list'),
url('^vlans/(?P<pk>\d+)/$', VlanDetail.as_view(), name='network.vlan'), url('^vlans/(?P<vid>\d+)/$', VlanDetail.as_view(), name='network.vlan'),
) )
...@@ -71,6 +71,8 @@ class VlanDetail(UpdateView): ...@@ -71,6 +71,8 @@ class VlanDetail(UpdateView):
model = Vlan model = Vlan
template_name = "network/vlan-edit.html" template_name = "network/vlan-edit.html"
form_class = VlanForm form_class = VlanForm
slug_field = 'vid'
slug_url_kwarg = 'vid'
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(VlanDetail, self).get_context_data(**kwargs) context = super(VlanDetail, self).get_context_data(**kwargs)
......
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