Beispiel #1
0
def userinfo(request, page):
    page = assetsglobal.Init(page)
    totalitems = models.userinfo.objects.filter(id__gt=0).count()
    ROW = 5
    getitems = assetsglobal.getitems(int(page), int(totalitems), ROW)
    getitems01 = models.userinfo.objects.filter(
        id__gt=0)[getitems.From():getitems.To()]
    Totalpage = getitems.totalpage()
    getMark = assetsglobal.getmark('/user/info/', Totalpage, int(page))
    #用户与权限
    user = request.session.get('user')
    privilege = request.session.get('privilege')
    info = {}
    pris = ['', 'user_mg_1', 'assets_mg_2', 'options_3']
    for i in xrange(1, 4):
        if str(i) in privilege:
            info[pris[i]] = True
        else:
            info[pris[i]] = False
    info['user'] = user
    form = {}
    form['result'] = getitems01
    form['pager'] = getMark
    endinfo = dict({'model': form}, **info)
    #print endinfo
    return render_to_response('user.html',
                              endinfo,
                              context_instance=RequestContext(request))
Beispiel #2
0
def userinfo(request,page):
    page = assetsglobal.Init(page)
    totalitems = models.userinfo.objects.filter(id__gt=0).count()
    ROW = 5
    getitems = assetsglobal.getitems(int(page),int(totalitems),ROW)
    getitems01 = models.userinfo.objects.filter(id__gt=0)[getitems.From():getitems.To()]
    Totalpage = getitems.totalpage()
    getMark = assetsglobal.getmark('/user/info/',Totalpage,int(page))
    #用户与权限
    user = request.session.get('user')
    privilege = request.session.get('privilege')
    info = {}
    pris = ['','user_mg_1','assets_mg_2','options_3']
    for i in xrange(1,4):
        if str(i) in privilege:
            info[pris[i]] = True
        else:
            info[pris[i]] = False
    info['user'] = user
    form = {}
    form['result'] = getitems01
    form['pager'] = getMark
    endinfo = dict({'model':form},**info)
    #print endinfo
    return render_to_response('user.html',endinfo,context_instance=RequestContext(request))
Beispiel #3
0
def mgma(request,page):
    page = assetsglobal.Init(page)
    totalitems = models.Machines.objects.filter(id__gt=0).count()
    ROW = 5
    getitems = assetsglobal.getitems(int(page),int(totalitems),ROW)
    getitems01 = models.Machines.objects.filter(id__gt=0)[getitems.From():getitems.To()]
    Totalpage = getitems.totalpage()
    getMark = assetsglobal.getmark('/assets/mgma/',Totalpage,int(page))
    macroom = models.MachineRoom.objects.filter(id__gt=0)
    cbandroom = {}
    for i in macroom:
        cbs = models.Cabinet.objects.filter(room=i)
        cbandroom[i] = cbs

    #用户与权限
    user = request.session.get('user')
    privilege = request.session.get('privilege')
    info = {}
    pris = ['','user_mg_1','assets_mg_2','options_3']
    for i in xrange(1,4):
        if str(i) in privilege:
            info[pris[i]] = True
        else:
            info[pris[i]] = False
    info['user'] = user
    form = {}
    form['result'] = getitems01
    form['pager'] = getMark
    form['macroom'] = macroom
    form['cabinet'] = cbandroom
    endinfo = dict({'model':form},**info)
    return render_to_response('mgma.html',endinfo,context_instance=RequestContext(request))
Beispiel #4
0
def userinfo(request, page):
    page = assetsglobal.Init(page)
    totalitems = models.userinfo.objects.filter(id__gt=0).count()
    ROW = 5
    getitems = assetsglobal.getitems(int(page), int(totalitems), ROW)
    getitems01 = models.userinfo.objects.filter(id__gt=0)[getitems.From() : getitems.To()]
    Totalpage = getitems.totalpage()
    getMark = assetsglobal.getmark("/user/info/", Totalpage, int(page))
    # 用户与权限
    user = request.session.get("user")
    privilege = request.session.get("privilege")
    info = {}
    pris = ["", "user_mg_1", "assets_mg_2", "options_3"]
    for i in xrange(1, 4):
        if str(i) in privilege:
            info[pris[i]] = True
        else:
            info[pris[i]] = False
    info["user"] = user
    form = {}
    form["result"] = getitems01
    form["pager"] = getMark
    endinfo = dict({"model": form}, **info)
    # print endinfo
    return render_to_response("user.html", endinfo, context_instance=RequestContext(request))
Beispiel #5
0
def mgma(request, page):
    page = assetsglobal.Init(page)
    totalitems = models.Machines.objects.filter(id__gt=0).count()
    ROW = 5
    getitems = assetsglobal.getitems(int(page), int(totalitems), ROW)
    getitems01 = models.Machines.objects.filter(
        id__gt=0)[getitems.From():getitems.To()]
    Totalpage = getitems.totalpage()
    getMark = assetsglobal.getmark('/assets/mgma/', Totalpage, int(page))
    macroom = models.MachineRoom.objects.filter(id__gt=0)
    cbandroom = {}
    for i in macroom:
        cbs = models.Cabinet.objects.filter(room=i)
        cbandroom[i] = cbs

    #用户与权限
    user = request.session.get('user')
    privilege = request.session.get('privilege')
    info = {}
    pris = ['', 'user_mg_1', 'assets_mg_2', 'options_3']
    for i in xrange(1, 4):
        if str(i) in privilege:
            info[pris[i]] = True
        else:
            info[pris[i]] = False
    info['user'] = user
    form = {}
    form['result'] = getitems01
    form['pager'] = getMark
    form['macroom'] = macroom
    form['cabinet'] = cbandroom
    endinfo = dict({'model': form}, **info)
    return render_to_response('mgma.html',
                              endinfo,
                              context_instance=RequestContext(request))