update the net_detail_view to display the NetDetailTable correctly
This commit is contained in:
parent
d0e71ad7fb
commit
2d06992811
|
@ -2,5 +2,8 @@
|
||||||
{% load render_table from django_tables2 %}
|
{% load render_table from django_tables2 %}
|
||||||
{% block section_title %}{{ net.name }}{% endblock %}
|
{% block section_title %}{{ net.name }}{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% render_table net %}
|
{% if net.description %}
|
||||||
|
<p>{{ net.description }}</p>
|
||||||
|
{% endif %}
|
||||||
|
{% render_table table %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -88,9 +88,12 @@ def nets_table_view(request, customer_id):
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def net_detail_view(request, pk):
|
def net_detail_view(request, pk):
|
||||||
table = NetDetailTable(Net.objects.filter(pk=pk))
|
net = get_object_or_404(Net, pk=pk)
|
||||||
|
table = NetDetailTable(DeviceInNet.objects.filter(net=net))
|
||||||
RequestConfig(request).configure(table)
|
RequestConfig(request).configure(table)
|
||||||
return render(request, 'inventory/net_details.html', {'net': table})
|
return render(request, 'inventory/net_details.html',
|
||||||
|
{'table': table,
|
||||||
|
'net': net})
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
|
Loading…
Reference in New Issue