Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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
Exemplo n.º 4
0
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