File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 1- from . import date
1+ from . import date
2+
3+
4+
You can’t perform that action at this time.
0 commit comments