示例#1
0
 def get(self, request, *args, **kwargs):
     context = {
         'pings': self._pings(request.user),
     }
     total_num_pings = self._total_num_pings(request.user)
     if total_num_pings:
         context['num_passing'] = Ping.num_passing(request.user.company_id)
         context['num_failing'] = Ping.num_failing(request.user.company_id)
         context['total_num_pings'] = total_num_pings
         context['percent_passing'] = round(
             (float(context['num_passing']) / float(total_num_pings)) * 100)
     return self.render_to_response(context)
示例#2
0
 def get(self, request, *args, **kwargs):
     context = {
         'pings': self._pings(request.user),
     }
     total_num_pings = self._total_num_pings(request.user)
     if total_num_pings:
         context['num_passing'] = Ping.num_passing(request.user.company_id)
         context['num_failing'] = Ping.num_failing(request.user.company_id)
         context['total_num_pings'] = total_num_pings
         context['percent_passing'] = round(
             (float(context['num_passing']) / float(total_num_pings)) * 100
         )
     return self.render_to_response(context)
示例#3
0
    def get(self, request, secret_key):

        company = Company.objects.get(secret_key=secret_key)

        context = {'pings': self._pings(company), 'public': True}
        total_num_pings = self._total_num_pings(company)
        if total_num_pings:
            context['num_passing'] = Ping.num_passing(company.id)
            context['num_failing'] = Ping.num_failing(company.id)
            context['total_num_pings'] = total_num_pings
            context['percent_passing'] = round(
                (float(context['num_passing']) / float(total_num_pings)) * 100)
        return self.render_to_response(context)
示例#4
0
    def get(self, request, secret_key):

        company = Company.objects.get(secret_key=secret_key)

        context = {
            'pings': self._pings(company),
            'public': True
        }
        total_num_pings = self._total_num_pings(company)
        if total_num_pings:
            context['num_passing'] = Ping.num_passing(company.id)
            context['num_failing'] = Ping.num_failing(company.id)
            context['total_num_pings'] = total_num_pings
            context['percent_passing'] = round(
                (float(context['num_passing']) / float(total_num_pings)) * 100
            )
        return self.render_to_response(context)