def getquerydict(request): """ getquerydict方法返回根据url解析出来的统一格式的请求参数 e.g. http://jdata.domain/api/getquerydict?_o=feedbacklog&_tstep=5&_dataclean=0&_fields=count&s=201203051555&e=201203061555&_lines=fields """ path = request.get_full_path() DM = DataModel(path=path) return DM.get_query_dict(path)
def getquerydict(request): """ getquerydict方法返回根据url解析出来的统一格式的请求参数 e.g. http://jdata.domain/api/getquerydict?_o=feedbacklog&_tstep=5&_dataclean=0&_fields=count&s=201203051555&e=201203061555&_lines=fields """ path=request.get_full_path() DM = DataModel(path = path) return DM.get_query_dict(path)
def get(request, linechart = False): path = request.get_full_path() if linechart: path = path + '&_linechart' DM = DataModel(path=path) client = request.META.get('REMOTE_ADDR','') if DM.ALLOWIPS and (client not in DM.ALLOWIPS): raise AccessDenied('Your IP `'+client+'` is not trusted for `'+DM.objectname+'`.') rst=DM.Data.get(DM.get_query_dict(path)) return rst
def get(request, linechart=False): path = request.get_full_path() if linechart: path = path + '&_linechart' DM = DataModel(path=path) client = request.META.get('REMOTE_ADDR', '') if DM.ALLOWIPS and (client not in DM.ALLOWIPS): raise AccessDenied('Your IP `' + client + '` is not trusted for `' + DM.objectname + '`.') rst = DM.Data.get(DM.get_query_dict(path)) return rst