hockey-blast-common-lib 0.1.36__tar.gz → 0.1.38__tar.gz
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-0.1.36 → hockey_blast_common_lib-0.1.38}/PKG-INFO +1 -1
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/models.py +8 -1
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/skills_in_divisions.py +11 -11
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib.egg-info/PKG-INFO +1 -1
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/setup.py +1 -1
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/MANIFEST.in +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/README.md +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/__init__.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/aggregate_all_stats.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/aggregate_goalie_stats.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/aggregate_human_stats.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/aggregate_referee_stats.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/aggregate_skater_stats.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/assign_skater_skill.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/db_connection.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/dump_sample_db.sh +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/options.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/restore_sample_db.sh +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/skills_propagation.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/stats_models.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/stats_utils.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/utils.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/wsgi.py +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib.egg-info/SOURCES.txt +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib.egg-info/dependency_links.txt +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib.egg-info/requires.txt +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib.egg-info/top_level.txt +0 -0
- {hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/setup.cfg +0 -0
Binary file
|
{hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/models.py
RENAMED
@@ -343,7 +343,14 @@ class TeamInTTS(db.Model):
|
|
343
343
|
db.UniqueConstraint('org_id', 'team_id', 'tts_team_id', name='_org_team_tts_uc'),
|
344
344
|
)
|
345
345
|
|
346
|
-
|
346
|
+
class RequestLog(db.Model):
|
347
|
+
__tablename__ = 'request_logs'
|
348
|
+
id = db.Column(db.Integer, primary_key=True)
|
349
|
+
user_agent = db.Column(db.String, nullable=False)
|
350
|
+
client_ip = db.Column(db.String, nullable=False)
|
351
|
+
path = db.Column(db.String, nullable=False)
|
352
|
+
timestamp = db.Column(db.DateTime, nullable=False)
|
353
|
+
cgi_params = db.Column(db.String, nullable=True)
|
347
354
|
|
348
355
|
# # MANUAL AMENDS HAPPEN HERE :)
|
349
356
|
# from db_connection import create_session
|
@@ -48,11 +48,11 @@ def analyze_levels(org):
|
|
48
48
|
|
49
49
|
session.close()
|
50
50
|
|
51
|
-
def
|
51
|
+
def fill_seed_levels():
|
52
52
|
session = create_session("boss")
|
53
53
|
|
54
54
|
# List of Skill objects based on the provided comments
|
55
|
-
|
55
|
+
levels = [
|
56
56
|
Level(is_seed=True, org_id=1, skill_value=10.0, level_name='Adult Division 1', level_alternative_name='Senior A'),
|
57
57
|
Level(is_seed=True, org_id=1, skill_value=20.0, level_name='Adult Division 2', level_alternative_name='Senior B'),
|
58
58
|
Level(is_seed=True, org_id=1, skill_value=30.0, level_name='Adult Division 3A', level_alternative_name='Senior BB'),
|
@@ -71,26 +71,26 @@ def fill_seed_skills():
|
|
71
71
|
Level(is_seed=True, org_id=1, skill_value=90.0, level_name='Adult Division 9', level_alternative_name='Senior EEEEE')
|
72
72
|
]
|
73
73
|
|
74
|
-
for skill in
|
74
|
+
for skill in levels:
|
75
75
|
session.add(skill)
|
76
76
|
session.commit()
|
77
77
|
|
78
78
|
print("Seed skills have been populated into the database.")
|
79
79
|
|
80
|
-
def
|
80
|
+
def assign_fake_level_to_divisions(session, fake_level):
|
81
81
|
# Assign the special fake Skill to every existing Division
|
82
82
|
divisions = session.query(Division).all()
|
83
83
|
for division in divisions:
|
84
|
-
division.skill_id =
|
84
|
+
division.skill_id = fake_level.id
|
85
85
|
session.commit()
|
86
86
|
print("Assigned special fake Skill to all Division records.")
|
87
87
|
|
88
|
-
def
|
88
|
+
def delete_all_levels():
|
89
89
|
session = create_session("boss")
|
90
|
-
|
91
|
-
|
90
|
+
fake_level = get_fake_level(session)
|
91
|
+
assign_fake_level_to_divisions(session, fake_level)
|
92
92
|
# Delete all Skill records except the fake skill
|
93
|
-
session.query(Level).filter(Level.id !=
|
93
|
+
session.query(Level).filter(Level.id != fake_level.id).delete(synchronize_session=False)
|
94
94
|
session.commit()
|
95
95
|
print("All Skill records except the fake skill have been deleted.")
|
96
96
|
|
@@ -123,7 +123,7 @@ def populate_league_ids():
|
|
123
123
|
print("League IDs have been populated into the Season table.")
|
124
124
|
|
125
125
|
#if __name__ == "__main__":
|
126
|
-
#
|
127
|
-
#
|
126
|
+
# delete_all_levels()
|
127
|
+
#fill_seed_levels()
|
128
128
|
#populate_season_ids() # Call the function to populate season_ids
|
129
129
|
#populate_league_ids() # Call the new function to populate league_ids
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name='hockey-blast-common-lib', # The name of your package
|
5
|
-
version='0.1.
|
5
|
+
version='0.1.38',
|
6
6
|
description='Common library for shared functionality and DB models',
|
7
7
|
author='Pavel Kletskov',
|
8
8
|
author_email='kletskov@gmail.com',
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/options.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/utils.py
RENAMED
File without changes
|
{hockey_blast_common_lib-0.1.36 → hockey_blast_common_lib-0.1.38}/hockey_blast_common_lib/wsgi.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|