From 9f1932337cf7e05a86a2f2d36480541db6bd889b Mon Sep 17 00:00:00 2001
From: xinjiel2 <xinjielan1@gmail.com>
Date: Sat, 11 May 2019 17:51:17 +1000
Subject: [PATCH] edited view

---
 web_app_django/tweet/views.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/web_app_django/tweet/views.py b/web_app_django/tweet/views.py
index 5f86cb5..b7bdf01 100644
--- a/web_app_django/tweet/views.py
+++ b/web_app_django/tweet/views.py
@@ -16,12 +16,22 @@ def index(request):
     
     if error == "no":
         docs = SERVER['tweet_results']
-        print(docs)
-        for doc in docs:
+        #print(docs)
+        #print(docs.view('city/city-view',key = "melbourne"))
 
-            print(docs[doc])
+
+        #GET /tweet_resutls/_design/city/_view/city-view HTTP/1.1
+
+        cityInfo = []
+        for doc in docs.view('city/city-view',group = True):
+
+            print(doc.key, doc.value)
+            cityInfo.append(doc)
+        print(cityInfo)
             
-            context = {'file':docs[doc]}
+        context = {'cityInfo':cityInfo}
+
+        #context = {'file':2}
     else:
         context = {'file':error}
 
-- 
GitLab