2020-04-01 17:08:47 -04:00
|
|
|
from django.http import HttpResponse
|
|
|
|
from django.views.generic import View
|
|
|
|
|
2022-10-07 15:03:52 -04:00
|
|
|
from dcim.models import Site
|
|
|
|
from utilities.views import register_model_view
|
2020-04-01 17:08:47 -04:00
|
|
|
from .models import DummyModel
|
|
|
|
|
|
|
|
|
|
|
|
class DummyModelsView(View):
|
|
|
|
|
|
|
|
def get(self, request):
|
|
|
|
instance_count = DummyModel.objects.count()
|
|
|
|
return HttpResponse(f"Instances: {instance_count}")
|
2022-10-07 15:03:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
@register_model_view(Site, 'extra', path='other-stuff')
|
|
|
|
class ExtraCoreModelView(View):
|
|
|
|
|
|
|
|
def get(self, request, pk):
|
|
|
|
return HttpResponse("Success!")
|