From 77fc37c92c86faf275326f3564bb95fae287e12b Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Fri, 18 Jan 2019 17:30:58 +0800
Subject: [PATCH] .
---
chapter2/mysite/myapp/templates/myapp/result.html | 1 +
chapter2/mysite/myapp/views.py | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/chapter2/mysite/myapp/templates/myapp/result.html b/chapter2/mysite/myapp/templates/myapp/result.html
index 9d7c9dc..3b9384d 100644
--- a/chapter2/mysite/myapp/templates/myapp/result.html
+++ b/chapter2/mysite/myapp/templates/myapp/result.html
@@ -9,6 +9,7 @@
diff --git a/chapter2/mysite/myapp/views.py b/chapter2/mysite/myapp/views.py
index 65d3a16..367104f 100644
--- a/chapter2/mysite/myapp/views.py
+++ b/chapter2/mysite/myapp/views.py
@@ -30,5 +30,7 @@ def crawl(request):
def result(request):
from_type_info = json.loads(Datas.objects.filter(key='from_type').first().data)
top10_sells = [entry for entry in Top10Sells.objects.order_by('id').values()]
+
+ last_month_sell = json.loads(Datas.objects.filter(key='last_month_sell').first().data)
return render(request, 'myapp/result.html', {"from_type_info": from_type_info,
- "top10_sells": top10_sells})
\ No newline at end of file
+ "top10_sells": top10_sells, "last_month_sell": last_month_sell})
\ No newline at end of file