def render_to_response(self, context, *args, **kwargs): if context is None: context = {} context['custom_check_types'] = add_custom_check_plugins() context['checkresults'] = self.object.statuscheckresult_set.order_by( '-time_complete')[:100] return super(StatusCheckDetailView, self).render_to_response(context, *args, **kwargs)
def render_to_response(self, context, *args, **kwargs): context = super(StatusCheckListView, self).get_context_data(**kwargs) if context is None: context = {} context['custom_check_types'] = add_custom_check_plugins() context['checks'] = StatusCheck.objects.all().order_by('name').prefetch_related('service_set', 'instance_set') return super(StatusCheckListView, self).render_to_response(context, *args, **kwargs)
def get_context_data(self, **kwargs): context = super(InstanceDetailView, self).get_context_data(**kwargs) date_from = date.today() - relativedelta(day=1) context['custom_check_types'] = add_custom_check_plugins() context['report_form'] = StatusCheckReportForm(initial={ 'checks': self.object.status_checks.all(), 'service': self.object, 'date_from': date_from, 'date_to': date_from + relativedelta(months=1) - relativedelta(days=1) }) return context