You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
neptune/core/ui/views/drilldown.py

24 lines
760 B
Python

from django.conf import settings
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import render
from django.views import View
from core.lib.opensearch import initialise_opensearch
client = initialise_opensearch()
class Drilldown(LoginRequiredMixin, View):
template_name = "ui/drilldown.html"
plan_name = "drilldown"
def get(self, request):
if not request.user.has_plan(self.plan_name):
return render(request, "denied.html")
context = {
"fields": settings.OPENSEARCH_MAIN_SEARCH_FIELDS,
"sizes": settings.OPENSEARCH_MAIN_SIZES,
"timescales": settings.OPENSEARCH_MAIN_TIMESCALES,
}
return render(request, self.template_name, context)