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

Closes #3731: Change Graph.type to a ContentType foreign key field

This commit is contained in:
Jeremy Stretch
2019-12-06 10:32:59 -05:00
parent ec9443edb8
commit 7518174374
12 changed files with 112 additions and 51 deletions

View File

@ -6,7 +6,7 @@ from django.db.models import Count, OuterRef, Subquery
from django.shortcuts import get_object_or_404, redirect, render
from django.views.generic import View
from extras.models import Graph, GRAPH_TYPE_PROVIDER
from extras.models import Graph
from utilities.forms import ConfirmationForm
from utilities.views import (
BulkDeleteView, BulkEditView, BulkImportView, ObjectDeleteView, ObjectEditView, ObjectListView,
@ -36,7 +36,7 @@ class ProviderView(PermissionRequiredMixin, View):
provider = get_object_or_404(Provider, slug=slug)
circuits = Circuit.objects.filter(provider=provider).prefetch_related('type', 'tenant', 'terminations__site')
show_graphs = Graph.objects.filter(type=GRAPH_TYPE_PROVIDER).exists()
show_graphs = Graph.objects.filter(type__model='provider').exists()
return render(request, 'circuits/provider.html', {
'provider': provider,