Changed timelinestatistic to allow dates & ints as key, as to allow a simple 'year' key
This commit is contained in:
parent
e59fd63237
commit
d0918ae953
3 changed files with 3 additions and 3 deletions
|
|
@ -21,7 +21,7 @@ class GameOrderStatistic(StatisticBase):
|
|||
}
|
||||
|
||||
class TimeLineStatistic(StatisticBase):
|
||||
result: Dict[date, int]
|
||||
result: Dict[Union[date, int], int]
|
||||
|
||||
model_config = {
|
||||
'validate_assignment':True
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ def get_amount_of_games_played_per_year(query: ExpansionFilteringParams = Depend
|
|||
|
||||
for year in range(first_year_played, current_year + 1):
|
||||
plays_in_year = list(filter(lambda x: x.play_date.year == year, all_plays))
|
||||
years_plays_dict[datetime(year, 1,1)] = len(plays_in_year)
|
||||
years_plays_dict[year] = len(plays_in_year)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ sqlite_url = definitions.SQLITE_URL
|
|||
|
||||
|
||||
connect_args = {"check_same_thread": False}
|
||||
engine = create_engine(sqlite_url, echo=False, connect_args=connect_args)
|
||||
engine = create_engine(sqlite_url, echo=True, connect_args=connect_args)
|
||||
|
||||
def get_session():
|
||||
with Session(engine) as session:
|
||||
|
|
|
|||
Loading…
Reference in a new issue