hockey-blast-common-lib 0.1.34__py3-none-any.whl → 0.1.35__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz +0 -0
- hockey_blast_common_lib/models.py +1 -1
- hockey_blast_common_lib/skills_in_divisions.py +1 -16
- hockey_blast_common_lib/utils.py +16 -0
- {hockey_blast_common_lib-0.1.34.dist-info → hockey_blast_common_lib-0.1.35.dist-info}/METADATA +1 -1
- {hockey_blast_common_lib-0.1.34.dist-info → hockey_blast_common_lib-0.1.35.dist-info}/RECORD +8 -8
- {hockey_blast_common_lib-0.1.34.dist-info → hockey_blast_common_lib-0.1.35.dist-info}/WHEEL +0 -0
- {hockey_blast_common_lib-0.1.34.dist-info → hockey_blast_common_lib-0.1.35.dist-info}/top_level.txt +0 -0
Binary file
|
@@ -224,7 +224,7 @@ class Organization(db.Model):
|
|
224
224
|
id = db.Column(db.Integer, primary_key=True)
|
225
225
|
alias = db.Column(db.String(100), unique=True)
|
226
226
|
organization_name = db.Column(db.String(100), unique=True)
|
227
|
-
website = db.Column(db.String(100), nullable=True)
|
227
|
+
website = db.Column(db.String(100), nullable=True)
|
228
228
|
|
229
229
|
class Penalty(db.Model):
|
230
230
|
__tablename__ = 'penalties'
|
@@ -7,6 +7,7 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
7
7
|
|
8
8
|
from hockey_blast_common_lib.models import Game, Division, Level, Season, League
|
9
9
|
from hockey_blast_common_lib.db_connection import create_session
|
10
|
+
from hockey_blast_common_lib.utils import get_fake_skill
|
10
11
|
|
11
12
|
def analyze_levels(org):
|
12
13
|
session = create_session(org)
|
@@ -76,22 +77,6 @@ def fill_seed_skills():
|
|
76
77
|
|
77
78
|
print("Seed skills have been populated into the database.")
|
78
79
|
|
79
|
-
def get_fake_skill(session):
|
80
|
-
# Create a special fake Skill with org_id == -1 and skill_value == -1
|
81
|
-
fake_skill = session.query(Level).filter_by(org_id=1, level_name='Fake Skill').first()
|
82
|
-
if not fake_skill:
|
83
|
-
fake_skill = Level(
|
84
|
-
org_id=1,
|
85
|
-
skill_value=-1,
|
86
|
-
level_name='Fake Skill',
|
87
|
-
level_alternative_name='',
|
88
|
-
is_seed=False
|
89
|
-
)
|
90
|
-
session.add(fake_skill)
|
91
|
-
session.commit()
|
92
|
-
print("Created special fake Skill record.")
|
93
|
-
return fake_skill
|
94
|
-
|
95
80
|
def assign_fake_skill_to_divisions(session, fake_skill):
|
96
81
|
# Assign the special fake Skill to every existing Division
|
97
82
|
divisions = session.query(Division).all()
|
hockey_blast_common_lib/utils.py
CHANGED
@@ -98,6 +98,22 @@ def assign_ranks(stats_dict, field, reverse_rank=False):
|
|
98
98
|
for rank, (key, stat) in enumerate(sorted_stats, start=1):
|
99
99
|
stats_dict[key][f'{field}_rank'] = rank
|
100
100
|
|
101
|
+
def get_fake_skill(session):
|
102
|
+
# Create a special fake Skill with org_id == -1 and skill_value == -1
|
103
|
+
fake_skill = session.query(Level).filter_by(org_id=1, level_name='Fake Skill').first()
|
104
|
+
if not fake_skill:
|
105
|
+
fake_skill = Level(
|
106
|
+
org_id=1,
|
107
|
+
skill_value=-1,
|
108
|
+
level_name='Fake Skill',
|
109
|
+
level_alternative_name='',
|
110
|
+
is_seed=False
|
111
|
+
)
|
112
|
+
session.add(fake_skill)
|
113
|
+
session.commit()
|
114
|
+
print("Created special fake Skill record.")
|
115
|
+
return fake_skill
|
116
|
+
|
101
117
|
#TEST DB CONNECTION, PERMISSIONS...
|
102
118
|
# from hockey_blast_common_lib.db_connection import create_session
|
103
119
|
# session = create_session("frontend")
|
{hockey_blast_common_lib-0.1.34.dist-info → hockey_blast_common_lib-0.1.35.dist-info}/RECORD
RENAMED
@@ -7,17 +7,17 @@ hockey_blast_common_lib/aggregate_skater_stats.py,sha256=LY6temy5zzqJ85ENymt9nEf
|
|
7
7
|
hockey_blast_common_lib/assign_skater_skill.py,sha256=p-0fbodGpM8BCjKHDpxNb7BH2FcIlBsJwON844KNrUY,1817
|
8
8
|
hockey_blast_common_lib/db_connection.py,sha256=HvPxDvOj7j5H85RfslGvHVNevfg7mKCd0syJ6NX21mU,1890
|
9
9
|
hockey_blast_common_lib/dump_sample_db.sh,sha256=MHPA-Ciod7wsvAlMbRtXFiyajgnEqU1xR59sJQ9UWR0,738
|
10
|
-
hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz,sha256=
|
11
|
-
hockey_blast_common_lib/models.py,sha256=
|
10
|
+
hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz,sha256=tBb-6pB9cDL3KyDJHiYzpbzRI-wsG6UMgCxbH6VZnNw,1033693
|
11
|
+
hockey_blast_common_lib/models.py,sha256=WLFPFoI3Rr_M58Vn8Ear2GrKW0bYPmBZFpYNb_sVRls,16039
|
12
12
|
hockey_blast_common_lib/options.py,sha256=6na8fo-5A2RBPpd_h-7dsqetOLSLoNEJg1QMYgl4jNs,792
|
13
13
|
hockey_blast_common_lib/restore_sample_db.sh,sha256=u2zKazC6vNMULkpYzI64nlneCWaGUtDHPBAU-gWgRbw,1861
|
14
|
-
hockey_blast_common_lib/skills_in_divisions.py,sha256=
|
14
|
+
hockey_blast_common_lib/skills_in_divisions.py,sha256=o7JiZkLBJcnn6J7nD2Pqt5bAhZofasXpfHB3uHe2huI,7005
|
15
15
|
hockey_blast_common_lib/skills_propagation.py,sha256=x6yy7fJ6IX3YiHqiP_v7-p_S2Expb8JJ-mWuajEFBdY,16388
|
16
16
|
hockey_blast_common_lib/stats_models.py,sha256=qvkt-XRFb4ZW7yBj7vltedzUS_YwWagm_efMRcsioSA,25120
|
17
17
|
hockey_blast_common_lib/stats_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
|
-
hockey_blast_common_lib/utils.py,sha256=
|
18
|
+
hockey_blast_common_lib/utils.py,sha256=MgodsQYxssUE5Oaqq87-YBDQN22n5OYYbgKT65cCq98,5228
|
19
19
|
hockey_blast_common_lib/wsgi.py,sha256=7LGUzioigviJp-EUhSEaQcd4jBae0mxbkyBscQfZhlc,730
|
20
|
-
hockey_blast_common_lib-0.1.
|
21
|
-
hockey_blast_common_lib-0.1.
|
22
|
-
hockey_blast_common_lib-0.1.
|
23
|
-
hockey_blast_common_lib-0.1.
|
20
|
+
hockey_blast_common_lib-0.1.35.dist-info/METADATA,sha256=WaYlunsVftS-1sn_uq3HPjlhUG-bOhUsBSOchAw5Pb0,318
|
21
|
+
hockey_blast_common_lib-0.1.35.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
22
|
+
hockey_blast_common_lib-0.1.35.dist-info/top_level.txt,sha256=wIR4LIkE40npoA2QlOdfCYlgFeGbsHR8Z6r0h46Vtgc,24
|
23
|
+
hockey_blast_common_lib-0.1.35.dist-info/RECORD,,
|
File without changes
|
{hockey_blast_common_lib-0.1.34.dist-info → hockey_blast_common_lib-0.1.35.dist-info}/top_level.txt
RENAMED
File without changes
|