def POST(self): #submit a meter reading, should be a json object webData = web.data() data = jsonvalidator.validateWebData(webData) timestamp = data['timestamp'] value = data['value'] dbconnector.writeMeterReading(timestamp, value) rawData = dbconnector.getAllData() usageRates = meteranalysis.getUsageRate(rawData) return render.data(usageRates, rawData)
def GET(self): #display general usage data and charts rawData = dbconnector.getAllData() usageRates = meteranalysis.getUsageRate(rawData) return render.data(usageRates, rawData)