-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathforce_calculate_statistics.py
More file actions
executable file
·56 lines (44 loc) · 1.67 KB
/
force_calculate_statistics.py
File metadata and controls
executable file
·56 lines (44 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#==============================================================================
# Forces the Statistics Data in Statistics_Raw_Data and Talk to be new calculated
#
#
#==============================================================================
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "subtitleStatus.settings")
import django
django.setup()
#from django.db.models import Q
from www.models import Statistics_Raw_Data, Talk
# Statistics_Raw_Data
my_statistics = Statistics_Raw_Data.objects.filter()
for any_statistics in my_statistics:
any_statistics.recalculate(True)
# Whole Talk Statistics
my_statistics = Talk.objects.filter()
for any_statistics in my_statistics:
any_statistics.recalculate(True)
"""
# Talk, only Speakers Time Statistics
my_statistics = Talk.objects.filter(recalculate_speakers_statistics = True)
for any_statistics in my_statistics:
any_statistics.recalculate_speakers_in_talk_statistics()
# Create the entries for Statistics_Event if necessary, ignore #3
all_events = Event.objects.all().exclude(id = 3)
for any in all_events:
any.create_statistics_event_entries()
# Event Statistics
my_statistics = Statistics_Event.objects.filter(recalculate_statistics = True)
for any_statistics in my_statistics:
any_statistics.recalculate()
# Talk_Persons
my_statistics = Talk_Persons.objects.filter(recalculate_statistics = True)
for any_statistics in my_statistics:
any_statistics.recalculate()
# Statistics Speakers
my_statistics = Statistics_Speaker.objects.filter(recalculate_statistics = True)
for any_statistics in my_statistics:
any_statistics.recalculate()
"""
print("Done!")