From 9eb41455e068198acf997c7c6ca9ed653fa7dbd8 Mon Sep 17 00:00:00 2001 From: Denis Tereshkin Date: Tue, 14 Mar 2017 22:38:38 +0700 Subject: [PATCH] Trades list: new trades are first --- views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/views.py b/views.py index a76b5c4..e0107ab 100644 --- a/views.py +++ b/views.py @@ -19,6 +19,7 @@ def overview(request): index = 0 for robot in robot_instances: entry = {} + entry['positions'] = dict() raw_state = r.get(robot.instanceId) if raw_state is not None: state = json.loads(str(raw_state, 'utf-8')) @@ -75,7 +76,7 @@ def delete_instance(request, instance_id): def trades_index(request): now = datetime.datetime.utcnow() new_trade_form = NewTradeForm(initial={'timestamp' : now}) - trades = Trade.objects.all() + trades = Trade.objects.all().order_by('-timestamp') template = loader.get_template('dashboard/trades.html') context = { 'trades' : trades,