hockey-blast-common-lib 0.1.35__tar.gz → 0.1.37__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.
Files changed (29) hide show
  1. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/PKG-INFO +1 -1
  2. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz +0 -0
  3. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/models.py +7 -1
  4. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/skills_in_divisions.py +12 -12
  5. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/utils.py +2 -2
  6. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib.egg-info/PKG-INFO +1 -1
  7. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/setup.py +1 -1
  8. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/MANIFEST.in +0 -0
  9. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/README.md +0 -0
  10. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/__init__.py +0 -0
  11. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/aggregate_all_stats.py +0 -0
  12. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/aggregate_goalie_stats.py +0 -0
  13. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/aggregate_human_stats.py +0 -0
  14. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/aggregate_referee_stats.py +0 -0
  15. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/aggregate_skater_stats.py +0 -0
  16. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/assign_skater_skill.py +0 -0
  17. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/db_connection.py +0 -0
  18. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/dump_sample_db.sh +0 -0
  19. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/options.py +0 -0
  20. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/restore_sample_db.sh +0 -0
  21. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/skills_propagation.py +0 -0
  22. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/stats_models.py +0 -0
  23. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/stats_utils.py +0 -0
  24. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib/wsgi.py +0 -0
  25. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib.egg-info/SOURCES.txt +0 -0
  26. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib.egg-info/dependency_links.txt +0 -0
  27. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib.egg-info/requires.txt +0 -0
  28. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/hockey_blast_common_lib.egg-info/top_level.txt +0 -0
  29. {hockey_blast_common_lib-0.1.35 → hockey_blast_common_lib-0.1.37}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hockey-blast-common-lib
3
- Version: 0.1.35
3
+ Version: 0.1.37
4
4
  Summary: Common library for shared functionality and DB models
5
5
  Author: Pavel Kletskov
6
6
  Author-email: kletskov@gmail.com
@@ -343,7 +343,13 @@ 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)
347
353
 
348
354
  # # MANUAL AMENDS HAPPEN HERE :)
349
355
  # from db_connection import create_session
@@ -7,7 +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
+ from hockey_blast_common_lib.utils import get_fake_level
11
11
 
12
12
  def analyze_levels(org):
13
13
  session = create_session(org)
@@ -48,11 +48,11 @@ def analyze_levels(org):
48
48
 
49
49
  session.close()
50
50
 
51
- def fill_seed_skills():
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
- skills = [
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 skills:
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 assign_fake_skill_to_divisions(session, fake_skill):
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 = fake_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 delete_all_skills():
88
+ def delete_all_levels():
89
89
  session = create_session("boss")
90
- fake_skill = get_fake_skill(session)
91
- assign_fake_skill_to_divisions(session, fake_skill)
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 != fake_skill.id).delete(synchronize_session=False)
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
- # delete_all_skills()
127
- #fill_seed_skills()
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
@@ -5,7 +5,7 @@ from datetime import datetime, timedelta
5
5
  # Add the package directory to the Python path
6
6
  sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
7
7
 
8
- from hockey_blast_common_lib.models import Organization, Human, Division
8
+ from hockey_blast_common_lib.models import Organization, Human, Division, Level
9
9
  from sqlalchemy.sql import func
10
10
 
11
11
 
@@ -98,7 +98,7 @@ 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):
101
+ def get_fake_level(session):
102
102
  # Create a special fake Skill with org_id == -1 and skill_value == -1
103
103
  fake_skill = session.query(Level).filter_by(org_id=1, level_name='Fake Skill').first()
104
104
  if not fake_skill:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hockey-blast-common-lib
3
- Version: 0.1.35
3
+ Version: 0.1.37
4
4
  Summary: Common library for shared functionality and DB models
5
5
  Author: Pavel Kletskov
6
6
  Author-email: kletskov@gmail.com
@@ -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.35',
5
+ version='0.1.37',
6
6
  description='Common library for shared functionality and DB models',
7
7
  author='Pavel Kletskov',
8
8
  author_email='kletskov@gmail.com',