def get_all(): s=sql() return s.get_all()
#!/usr/bin/env python2.7 import SOAPpy import time start_time = time.time() from db.mtsql import sql s = sql() server = SOAPpy.SOAPProxy("http://127.0.0.1:7777/") resp = server.get_last_3h() print resp print time.time() - start_time, "seconds" start_time = time.time() print s.get_last_3h() print time.time() - start_time, "seconds" #for item in resp: # print item.data #server.hello()
def get_last_24h(): s=sql() return s.get_last_24h()
def get_dayly(): s=sql() return s.get_dayly()
def get_hourly(): s=sql() return s.get_hourly()
def get_last(): s=sql() return s.get_last()
from django.contrib.auth.decorators import login_required from django import template from django.template.defaultfilters import stringfilter from django.template import * register = template.Library() from django.template import RequestContext import datetime from webstat import settings from db.mtsql import sql from weather.weather import Weather import os import SOAPpy s = sql() ### cpath = os.path.dirname(os.path.abspath(__file__)) spath = cpath[:-9]+"statics/images/" s=sql() w=Weather() #@login_required def hello(request): last3h = s.get_last_3h() last3hour = [] pres = [] time = []