Skip to content

Commit 8d4dba6

Browse files
author
ExpDev07
committed
small changes
1 parent d953967 commit 8d4dba6

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

app/data/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def get_data(type):
2929

3030
for item in data:
3131

32+
# Filter out all the dates.
33+
history = dict(filter(lambda element: date_util.is_date(element[0]), item.items()))A
34+
3235
# Normalize the item and append to locations.
3336
locations.append({
3437
# General info.
@@ -42,10 +45,10 @@ def get_data(type):
4245
},
4346

4447
# History.
45-
'history': dict(filter(lambda element: date_util.is_date(element[0]), item.items())),
48+
'history': history,
4649

47-
# TODO: Total.
48-
'total': 0
50+
# Latest statistic.
51+
'latest': sorted(history.values()),
4952
})
5053

5154
# Return the final data.
@@ -54,7 +57,5 @@ def get_data(type):
5457

5558

5659

57-
58-
5960

6061

app/utils/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
from . import date
1+
from . import date
2+
3+
4+

0 commit comments

Comments
 (0)