|
@@ -5,12 +5,17 @@ from django.http import HttpResponse
|
|
|
from django.views.generic import View
|
|
from django.views.generic import View
|
|
|
|
|
|
|
|
from dcim.models import Site
|
|
from dcim.models import Site
|
|
|
|
|
+from netbox.views import generic
|
|
|
from utilities.views import register_model_view
|
|
from utilities.views import register_model_view
|
|
|
-from .models import DummyModel
|
|
|
|
|
|
|
+from .models import DummyModel, DummyNetBoxModel
|
|
|
# Trigger registration of custom column
|
|
# Trigger registration of custom column
|
|
|
from .tables import mycol # noqa: F401
|
|
from .tables import mycol # noqa: F401
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#
|
|
|
|
|
+# DummyModel
|
|
|
|
|
+#
|
|
|
|
|
+
|
|
|
class DummyModelsView(View):
|
|
class DummyModelsView(View):
|
|
|
|
|
|
|
|
def get(self, request):
|
|
def get(self, request):
|
|
@@ -32,6 +37,18 @@ class DummyModelAddView(View):
|
|
|
return HttpResponse("Instance created")
|
|
return HttpResponse("Instance created")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#
|
|
|
|
|
+# DummyNetBoxModel
|
|
|
|
|
+#
|
|
|
|
|
+
|
|
|
|
|
+class DummyNetBoxModelView(generic.ObjectView):
|
|
|
|
|
+ queryset = DummyNetBoxModel.objects.all()
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+#
|
|
|
|
|
+# API
|
|
|
|
|
+#
|
|
|
|
|
+
|
|
|
@register_model_view(Site, 'extra', path='other-stuff')
|
|
@register_model_view(Site, 'extra', path='other-stuff')
|
|
|
class ExtraCoreModelView(View):
|
|
class ExtraCoreModelView(View):
|
|
|
|
|
|