1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Moved object context rendering to ObjectConfigContextView and standardized the template

This commit is contained in:
Jeremy Stretch
2018-06-28 13:48:12 -04:00
parent b952ec73ce
commit 62989ecb6e
8 changed files with 88 additions and 72 deletions

View File

@@ -19,6 +19,7 @@ from natsort import natsorted
from circuits.models import Circuit
from extras.models import Graph, TopologyMap, GRAPH_TYPE_INTERFACE, GRAPH_TYPE_SITE
from extras.views import ObjectConfigContextView
from ipam.models import Prefix, Service, VLAN
from utilities.forms import ConfirmationForm
from utilities.paginator import EnhancedPaginator
@@ -994,16 +995,9 @@ class DeviceConfigView(PermissionRequiredMixin, View):
})
class DeviceConfigContextView(View):
def get(self, request, pk):
device = get_object_or_404(Device, pk=pk)
return render(request, 'dcim/device_configcontext.html', {
'device': device,
'active_tab': 'config-context',
})
class DeviceConfigContextView(ObjectConfigContextView):
object_class = Device
base_template = 'dcim/device.html'
class DeviceCreateView(PermissionRequiredMixin, ObjectEditView):