Permalink
Browse files

Started adding table with info on history of pollutants in Beijing. W…

…ill use to generate graphs.
  • Loading branch information...
1 parent 416a2ed commit 81364dd692b3b6783ea27f4727711b01f30af35c @mpdaugherty committed Mar 12, 2010
Showing with 20 additions and 0 deletions.
  1. +20 −0 main.py
View
20 main.py
@@ -49,6 +49,26 @@ def getCurrentPollutantHTML(self, pollutant):
htmlReturnValue += "<div>Concentration: <span>"+str(pm2Status.concentration)+"</span></div>"
htmlReturnValue += "<div>AQI: <span>"+str(pm2Status.aqi)+"</span></div>"
+ # Next, add a table with the data on this pollutant from the last 24 hours.
+ lastDayStatuses = pm2Query.fetch(24)
+
+ htmlReturnValue += '<table class="pollutantHistory"/>'
+ htmlReturnValue += '<tr><td></td>'
+ for status in lastDayStatuses:
+ htmlReturnValue += '<th>' + str(status.date) + '</th>'
+ htmlReturnValue += '</tr>'
+
+ htmlReturnValue += '<tr><th>Concentration</th>'
+ for status in lastDayStatuses:
+ htmlReturnValue += '<td>' + str(status.concentration) + '</td>'
+ htmlReturnValue += '</tr>'
+
+ htmlReturnValue += '<tr><th>AQI</th>'
+ for status in lastDayStatuses:
+ htmlReturnValue += '<td>' + str(status.aqi) + '</td>'
+ htmlReturnValue += '</tr>'
+ htmlReturnValue += '</table>'
+
return htmlReturnValue
class UpdateStatusFromTwitter(webapp.RequestHandler):

0 comments on commit 81364dd

Please sign in to comment.