Ejemplo n.º 1
0
def matchs_compute(request):
    if request.user.id!=None and request.user.is_authenticated and request.user.is_superuser:
        compute_event_ranking()
        compute_group_ranking()
        compute_overall_ranking()
        return HttpResponse('{"result": true, "message":"No problem occured."}', content_type="application/json");
    else:
        raise PermissionDenied()
Ejemplo n.º 2
0
def matchs_compute(request):
    if request.user.id != None and request.user.is_authenticated and request.user.is_superuser:
        compute_event_ranking()
        compute_group_ranking()
        compute_overall_ranking()
        return HttpResponse(
            '{"result": true, "message":"No problem occured."}',
            content_type="application/json")
    else:
        raise PermissionDenied()
Ejemplo n.º 3
0
 def handle(self, *args, **options):
     begin = dt.combine(dates.AddDay(datetime.date.today(),-7), dt.min.time())
     active_events = BettableEvent.objects.filter(end_date__gte=begin).order_by('name')
     for event in active_events:
         providers = Provider.objects.filter(event__id=event.id)
         event_meta = get_event_meta(event)
         for provider in providers:
             provider.get_all_matches_info()
         for m_type in event_meta['final_phases'][1:]:
             complete_meta_for_type(event, m_type)
     compute_event_ranking()
     compute_group_ranking()
     compute_overall_ranking()
     generate_matchs()
Ejemplo n.º 4
0
 def handle(self, *args, **options):
     begin = dt.combine(dates.AddDay(datetime.date.today(), -7),
                        dt.min.time())
     active_events = BettableEvent.objects.filter(
         end_date__gte=begin).order_by('name')
     for event in active_events:
         providers = Provider.objects.filter(event__id=event.id)
         event_meta = get_event_meta(event)
         for provider in providers:
             provider.get_all_matches_info()
         for m_type in event_meta['final_phases'][1:]:
             complete_meta_for_type(event, m_type)
     compute_event_ranking()
     compute_group_ranking()
     compute_overall_ranking()
     generate_matchs()