• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python views.render_to_response_ex函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中videoclient.views.render_to_response_ex函数的典型用法代码示例。如果您正苦于以下问题:Python render_to_response_ex函数的具体用法?Python render_to_response_ex怎么用?Python render_to_response_ex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了render_to_response_ex函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: visitorcard

def visitorcard(request, vcid=None, project = None):
    
    data = dict()    
    data.update(getDefaultParams(request, 'visitors', project))    
    form = TestVisitorCard(request.POST, request.FILES)
    if form.is_valid():
        dt1 = "%s %s:%s:00" % (form.cleaned_data["dateVisit1"], form.cleaned_data["time11"], form.cleaned_data["time12"])
        dt2 = "%s %s:%s:00" % (form.cleaned_data["dateVisit2"], form.cleaned_data["time21"], form.cleaned_data["time22"])
        if form.cleaned_data["visitor"] and form.cleaned_data["person"]:
            if form.cleaned_data["vcid"]:
                VisitingCard.objects.filter(id=form.cleaned_data["vcid"]).update(visitor=PersonId.objects.get(id=form.cleaned_data["visitor"]), person=PersonId.objects.get(id=form.cleaned_data["person"]), ground=Ground.objects.get(id=form.cleaned_data["ground"]), dt_enter=dt1, dt_exit=dt2)
            else: vcid = VisitingCard.objects.create(visitor_id=form.cleaned_data["visitor"], person_id=form.cleaned_data["person"], ground_id=form.cleaned_data["ground"], dt_enter=dt1, dt_exit=dt2)
    else: logging.info(form.errors)
    data.update(getVisitorInfo(request))
    data.update(getGround(request))
    data.update(getDataDivision(request))
    if vcid: data.update(dataVisitors(request, vcid))
    dt = dict()
    data['learn'] = True
    dt["errors"] = form.errors
    dt["post"] = True if request.POST else False    
    data.update(dt)
    if project is not None:
        return render_to_response_ex(request, project + "visitorcard.html", data)
    else:
        return render_to_response_ex(request, "visitorcard.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:26,代码来源:views.py


示例2: photosperson

def photosperson(request, id, project=None):
    
    person = PersonId.objects.get(id = int(id)).person
    p = PersonId.objects.get(id = int(id))
    division = person.status.division.name
    
    if division == "Персоны":
        select_page = 'photosperson'
    elif division == "Посетители":
        select_page = 'photosvisitor'
    elif division == "Сотрудники":
        select_page = 'photosstaff'
    elif division == "Автообученные":
        select_page = 'photosauto'
        
    
    data = getDefaultParams(request, select_page, project)
    data.update(dataPhotoById(id))
    data.update(dataPerson(request, int(person.id), division))
    data['photos_'] = data['allphotos']['photos']
    data['person_id'] = p.id
    if request.COOKIES.has_key("eyes") and request.COOKIES["eyes"] == "true": 
        data["eyes"] = "true"
    
    if project is not None:
        return render_to_response_ex(request, project+"photosperson.html", data, context_instance=RequestContext(request))
    else:
        return render_to_response_ex(request, "photosperson.html", data, context_instance=RequestContext(request))
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:28,代码来源:views.py


示例3: anketavisitor

def anketavisitor(request, id=None, id2 = None, project = None):
    
    data = dict()
    data.update(getDefaultParams(request, 'anketavisitor', project))
    data.update(dataPerson(request, id, 'Посетители', id2, one = 1))
    data['learn'] = True
    if request.POST.has_key(ADDPHOTO) and len(str(data['user']['id_person']))>0 and data['user']['id_person']>0:
        str_redirect = ""
        if project is not None:
            str_redirect = '/'+project+'/addphotoperson/visitors/%s/' %int(data['user']['id_person'])
        else:
            str_redirect = '/addphotoperson/visitors/%s/' %int(data['user']['id_person'])
        if data.has_key('group'):
            str_redirect = str_redirect+"?group="+str(data['group'])            
        return HttpResponseRedirect(str_redirect)
        #return HttpResponseRedirect(getStrRedirect(data, '/addphotoperson/visitors/%s/' %int(data['user']['id_person']), project))
    
    if request.POST.has_key("first_name") and len(str(data['user']['id']))>0 and data['user']['id']>0:#first_nameADDPHOTO
        str_redirect = ""
        if project is not None:
            str_redirect = '/'+project+'/anketavisitor/%s/?save=1' %int(data['user']['id'])
        else:
            str_redirect = '/anketavisitor/%s/?save=1' %int(data['user']['id'])
        if data.has_key('group'):
            str_redirect = str_redirect+"&group="+str(data['group'])            
        if data.has_key('istraining') and data['istraining'] and data.has_key('learned'):
            str_redirect = str_redirect+"&learned="+str(data['learned'])
        return HttpResponseRedirect(str_redirect)
    
    if project is not None:
        return render_to_response_ex(request, project+"anketavisitor.html", data)
    else:
        return render_to_response_ex(request, "anketavisitor.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:33,代码来源:views.py


示例4: journal_videoanalytics

def journal_videoanalytics(request):

    data = dict()
    data = getIdentData(request)
    if space:
        s = commands.getoutput(space)
        s = s.replace("\n", "")
        m = re.match(r".*G *([0-9]+)%.*", s)
        if m and m.group(1):
            data["space"] = 100-int(m.group(1))

    data.update(getDefaultParams(request, 'journal_videoanalytics'))
    #data.update( {"csm": float(get_value_defaultparams(journalBoundCoeff))*100})
    data.update(dataVAJournal(request))
    #raise Exception(data["all_users"])
    data.update(getDataDivision(request))
    data.update(dataNavigation(request, data['all_users']))
    data["users"] = data["users"][data['start']-1:data['finish']-1]
    data.update(dataGet(request))
    
    #if request.GET.has_key('data') and not request.GET.has_key('countrows'):
    #    return render_to_response("datajournal.html", data)
    #elif request.GET.has_key('countrows'):
    #    return JsonResponse({'countrows': data['all_users']})
    #else:
    if request.GET.has_key('data') and not request.GET.has_key('countrows'):
        return render_to_response_ex(request, "data_journal_videoanalitics.html", data)
    return render_to_response_ex(request, "journal_videoanalytics.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:28,代码来源:views.py


示例5: kpp

def kpp(request, project=None):
    
    data = getDefaultParams(request, 'kpp', project)
    data.update(getSearchKpp(request))
    data.update(dataGuards(None, data["users"]))
    sort = [
            ["j_id"],
#            ["user", "kpp", "name"],
            ["kpp"],
#            ["user", "kpp", "name"],
            ["kpp"],            
            ["login"],
            ['logint_time'],
#            ["login"],
            ["logout"],
            ['logout_time'],
#            ["logout"],
#            ["staff", "person", "fio"]]
            ["fio"],
            ["status"]]
    data["users"] = GlobalSortUser(data["users"], sort, data["sorto"], data["up"])     
    data.update(dataNavigation(request, data['all_users']))    
    if project is not None:
        return render_to_response_ex(request, project+"kpp.html", data)
    else:
        return render_to_response_ex(request, "kpp.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:26,代码来源:views.py


示例6: settingspage

def settingspage(request, ident=False):
        
    from videoclient import models
    
    HOST, PORT, LOGIN, PASSWD, USER = initBalancer()
    SERVERC, PORTC, COMMUNICATORS = initCommunicators()
    index = 0
    if request.GET.has_key('index'):
        index = int(request.GET['index'])
    else:
        if 'index' in request.COOKIES:
            index = int(request.COOKIES['index'])        
        
    if index < 0:
        index = 0
    if index >= len(COMMUNICATORS):
        index = len(COMMUNICATORS)-1
        
    error = False
    c = Communicator(COMMUNICATORS[index]['host'], COMMUNICATORS[index]['port'])
    cameras = []
    try:
        cameras = c.getCameras()
        for camera in cameras:
            models.Camera.objects.get_or_create(ip = camera['ip'], type = camera['type'])
            camera['mode'] = int(c.getModeScheduler(camera['numcamera']))
    except:
        error = True
    
    c.close()
    del c
    
    
    
    dis_eye = None
    
    data = {'host': HTTP_HOST, 'select_page': 'settings',
                              'select_subpage': 'cameras', 'user': request.user.username,
                              'communicators': COMMUNICATORS, 'cameras': cameras,
                              'name': '%s:%s' %(COMMUNICATORS[index]['host'], COMMUNICATORS[index]['port']),
                              'error': error, 'index': index, 'modes': [0, 1, 2, -1],
                              'dis_eye': dis_eye,
                              'bal' : {'host':HOST, 'port':PORT, 'login':LOGIN, 'passwd':PASSWD, 'user':USER}
                              }
    
    data.update(getDefaultParams(request, 'settingspage'))
    data.update(dataNavigation(request, len(cameras)))
    
    if ident:
        from videoclient.views import getIdentData
        data.update(getIdentData(request))
        data.update(getDefaultParams(request, 'ident'))
        response =  render_to_response_ex(request, "po4ident.html", data)
    else:
        response =  render_to_response_ex(request, "po4settingspage.html", data)

    response.set_cookie("index", index) 
    
    return response
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:59,代码来源:views.py


示例7: visitors

def visitors(request, project=None):
    
    data = dict()
    data.update(getDefaultParams(request, 'visitors', project))
    data.update(dataVisitors(request))
    data.update(dataNavigation(request, len(data['visitingcard'])))
    if project is not None:    
        return render_to_response_ex(request, project+"visitors.html", data)
    else:
        return render_to_response_ex(request, "visitors.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:10,代码来源:views.py


示例8: staff

def staff(request, project=None):
    
    data = dict()
    data.update(getDefaultParams(request, 'staff', project))
    data.update(dataStaff(request))
    data.update(dataNavigation(request, len(data['staffs'])))
    if project is not None:
        return render_to_response_ex(request, project + "staff.html", data)
    else:
        return render_to_response_ex(request, "staff.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:10,代码来源:views.py


示例9: historychange

def historychange(request, project=None):
    
    data = getDefaultParams(request, 'historychange', project)
    data.update(getSearchHistory(request))    
    data.update(dataGuards(None, data["users"], is_person=True))
    data.update(dataNavigation(request, data['all_users']), is_person=True)
    if project is not None:
        return render_to_response_ex(request, project+"historychange.html", data)
    else:
        return render_to_response_ex(request, "historychange.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:10,代码来源:views.py


示例10: journal

def journal(request):
    
    data = getDefaultParams(request, 'journal')
    data.update(dataJournal(request))
    data.update(getDataDivision(request))
    data.update(dataNavigation(request, data['all_users']))
    data.update(dataGet(request))
    if request.GET.has_key('data'):
        return render_to_response_ex(request, "po4datajournal.html", data)
    else:
        return render_to_response_ex(request, "po4journal.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:11,代码来源:views.py


示例11: anketaauto

def anketaauto(request, id=None, id2 = None, project=None):
    
    data = dict()
    data.update(getDefaultParams(request, 'anketaauto', project))
    data.update(dataPerson(request, id, 'Автообученные', id2, one=1))
    data['learn'] = True
    if request.POST.has_key(ADDPHOTO) and len(str(data['user']['id_person']))>0 and data['user']['id_person']>0:
        return HttpResponseRedirect(getStrRedirect(data, '/addphotoperson/auto/%s/' %int(data['user']['id_person']), project))
    if project is not None:
        return render_to_response_ex(request,project + "anketaauto.html", data)
    else:
        return render_to_response_ex(request,"anketaauto.html", data)    
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:12,代码来源:views.py


示例12: user_list

def user_list(request, uid=None, num=1):
    if num == None: num = 1
    data = dict()
    data = getDefaultParams(request, 'control_settings_users', project)
    data["select_page"] = 'control_settings_users'
    data["user"] = request.user
    data["page"] = "user"
    try:
        HOST, PORT, LOGIN, PASSWORD, USER = initBalancer()
        data["HOST"] = HOST
        data["PORT"] = PORT        
        b = Balancer(HOST, PORT, LOGIN, PASSWORD, USER)
        if uid:
            data["ulogin"] = uid                
            params = b.getLoginParameters(uid)
            data["params"] = params
            data["number"] = config.number
            data["boolean"] = config.boolean
            data["text"] = config.text 
            post = request.POST
            save = False
            if "save" in post: save = True
            i = 0
            for base in params["bases"]:
                base["index"] = "params"
                base["params"] = sorted(base["params"], key=lambda x: x["name"]) 
                for p in base["params"]:
                    p["spin_id"] = i                
                    i += 1
                    p = get_params_value(p, p["name"])
                    s = "%s_%s" % (base["name"], p["name"])
                    p["id"] = s                    
                    if save:                    
                        if s in post:                      
                            if str(post[s] if post[s] != "" else "None") != str(p["val"]):
                                posts = post[s] #if post[s] != "" else False
                                if b.setParameter(value=posts, param=p["name"], toBase=base["name"]): p["val"] = posts
                                else: p["error"] = "ошибка параметра"
            b.close()
            del b
            return render_to_response_ex(request, "control_settings_user.html", data)
        users = b.getLogins()
        data["all_count"] = len(users)
        b.close()
        del b
        data = numerate(data, num=num, all_count=len(users))
        data["users"] = users[data["ind_start"]:data["ind_end"]]
        return render_to_response_ex(request, "control_settings_users.html", data)
    except:
        logging.exception("user_list "+str(sys.exc_info()))
        data["us_error"] = str(sys.exc_info())
        return render_to_response_ex(request, "control_settings_users.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:52,代码来源:views.py


示例13: default_params

def default_params(request):
    data = dict()
    data = getDefaultParams(request, 'control_settings_default', project)
    data["select_page"] = 'control_settings_default'
    data["user"] = request.user    
    data["page"] = "settings"
    data["title"] = _("Настройки по умолчанию")
    data["number"] = config.number
    data["boolean"] = config.boolean
    data["text"] = config.text
    post = request.POST
    base = "default"    
    data["base"] = base    
    data["max_length"] = config.max_text_width
    data["min_length"] = config.min_text_width
    data["val_length"] = config.text_length      
    try:
        HOST, PORT, LOGIN, PASSWORD, USER = initBalancer()
        data["HOST"] = HOST
        data["PORT"] = PORT    
        b = Balancer(HOST, PORT, LOGIN, PASSWORD, USER)
        """
        try:    
            if "add" in post: 
                form = AddParamsForm(post, request.FILES)
                if form.is_valid():
                    if not b.setParameter(value=form.cleaned_data["param_value"], param = form.cleaned_data["param_name"], toBase=base):
                        data["error_add"] = "Ошибка добавления параметра"
                        data["param_name"] = form.cleaned_data["param_name"]
                        data["param_value"] = form.cleaned_data["param_value"]
                else:
                    data["error_add"] = form.errors
        except:
            logging.exception("control_settings add new param "+str(sys.exc_info()))
            data["error_add"] = "Ошибка добавления параметра"    
        """
        params = b.getAllParameters()
        allparam = map(lambda x: x["params"], filter(lambda x: x["name"]==base, params))[0]
        allparam = sorted(allparam, key=lambda x: x["name"])
        #allparam = map(get_fullinfo, allparam)
       
        allparam = map(lambda x: get_fullinfo(x), allparam)
        data["params"] = allparam
        if "update" in post: 
            return render_to_response_ex(request, "control_settings_param.html", data) 
        #data["info"] = {"info": get_plist(request, allparam, "default")}
        b.close()
        del b
    except:
        logging.exception("default_params "+str(sys.exc_info()))
        data["us_error"] = str(sys.exc_info())
    return render_to_response_ex(request, "control_settings_settings.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:52,代码来源:views.py


示例14: learn_camera

def learn_camera(request, select_page, communicator, numcamera, person, project=None):
    
    from videoclient.views import initBalancer, initCommunicators
    from videoclient.communicator import *
    from videoclient.balancer import *
    from videoclient import models
    
    
    HOST, PORT, LOGIN, PASSWD, USER = initBalancer()
    SERVERC, PORTC, COMMUNICATORS = initCommunicators()
    
    server = COMMUNICATORS[int(communicator)]['host']
    port = COMMUNICATORS[int(communicator)]['port']
    
    mode = 0
    
    try:
        c = Communicator(server, int(port))
        mode = c.getModeScheduler(numcamera)
        c.close()
        del c
    except:
        pass
    
    
    user = request.user.username
    
    host = HTTP_HOST
    host2f = host.replace('/', '\%2F')
    
    data = {'user': request.user.username,
                        'communicator': communicator, 'person': person, 'server': server, 'port':port, 
                        'numcamera': numcamera, 'mode': mode,
                        'bal' : {'host':HOST, 'port':PORT, 'login':LOGIN, 'passwd':PASSWD, 'user':USER}}
    
    id = int(person)
    data['person'] = idToName(id)

    data.update(getDefaultParams(request, select_page, project))
    
    data['id'] = id
    data['addperson'] = idToName(id)
    person = PersonId.objects.get(id = int(id)).person
    data['user'] = person.getDict()
    data['learn'] = True
    if project is not None:
        return render_to_response_ex(request, project+"learn_camera2.html", data)
    else:
        return render_to_response_ex(request, "learn_camera2.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:49,代码来源:views.py


示例15: map

def map(request, map_id=None):

    data = dict()
    data = getIdentData(request)
    data.update(getDefaultParams(request, 'maps'))
    
    all_cameras = None
    try:
        all_cameras = Camera.objects.filter().order_by('pk')
    except:
        all_cameras = None
    
    data["all_cameras"] = all_cameras    
    
    map = dict()
    if map_id:
        try:
            map = get_object_or_404(Map, id=int(map_id))
        except:
            pass
    else:
        try:
            map = Map.objects.filter()[0]
        except:
            pass
    data["map"] = map
    data["map_is_exist"] = True
    
    data["image_size"] = get_image_size(map)
    
    try:
        map_obj_type_id = map.obj_type.pk
        map_obj_name_id = map.obj_name.pk
        map_city_id = map.city.pk
    except:
        map_obj_type_id = None
        map_obj_name_id = None
        map_city_id = None
        data["map_is_exist"] = False
        return render_to_response_ex(request, "maps.html", data)

    data["objTypeChoices"] = get_map_object_type_choices(form_mode='object_type_choices2', id=map_obj_type_id)
    data["cityChoices"] = get_map_city_choices(map.city.pk)
    data["objNames"] = get_map_objnames_choices(objtype_id=map_obj_type_id, city_id=map_city_id, objname_id=map_obj_name_id)
    
    data["map_terminals"] = MapTerminal.objects.filter(map=map.pk)
    data["map_terminal_cameras"] = MapCamera.objects.filter(map=map.pk)
    
    return render_to_response_ex(request, "maps.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:49,代码来源:views.py


示例16: autolist

def autolist(request, project = None):
    
    data = getDefaultParams(request, 'autolist', project)
    
    data.update(getSearchStaffs(request, division_auto))
    data.update(dataNavigation(request, data['users'].count()))
    data["users"] = data["users"][data['start']-1:data['finish']-1]
    data.update(dataGuards(None, data["users"]))
    if ('delo' in data and data['delo']) or ('concato' in data and data['concato']):
        return HttpResponseRedirect(getStrRedirect(data, '/autolist/', project))
    data.update(getDataPhotosView(request, data["users"]))
    if project is not None:
        return render_to_response_ex(request,project + "autolist.html", data)
    else:
        return render_to_response_ex(request,"autolist.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:15,代码来源:views.py


示例17: visitorslist

def visitorslist(request, project=None):
    
    data = getDefaultParams(request, 'visitorslist', project)
    
    data.update(getSearchVisitors(request))
    data.update(dataNavigation(request, data['users'].count()))
    data["users"] = data["users"][data['start']-1:data['finish']-1]
    data.update(dataGuards(None, data["users"]))
    if 'delo' in data and data['delo']:
        return HttpResponseRedirect(getStrRedirect(data, '/visitorslist/', project))
    data.update(getDataPhotosView(request, data["users"]))
    if project is not None:
        return render_to_response_ex(request, project+"visitorslist.html", data)
    else:
        return render_to_response_ex(request, "visitorslist.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:15,代码来源:views.py


示例18: setup

def setup(request):
    data = dict()
    if not request.user.is_authenticated():
        return HttpResponseRedirect("/")
    if request.REQUEST.has_key('period_storage_data'):
        try:
            period_storage_data = request.POST['period_storage_data']
            if str(period_storage_data).isdigit() and int(period_storage_data)>0:
                dp = DefaultParams.objects.get_or_create(name="period_storage_data")
                dp[0].value = period_storage_data
                dp[0].save() 
                return HttpResponse(True)
            return HttpResponse(False)
        except:
            logging.exception('setup: set period_storage_data '+str(sys.exc_info()))
            return HttpResponse(False)
    
    distr_version = None
    try:
        from videoclient import settings
        f = open(settings.VERSION_FILE, 'r+b')
        distr_version = f.read()
        f.close()
    except:
        logging.exception(str(sys.exc_info())) 
    data = {'version': VERSION, 'select_page': 'setup', 'user': request.user.username, 'distr_version': distr_version,}
    data['period']=get_value_defaultparams("period_storage_data")

    data.update(getDefaultParams(request, 'setup', ""))
    data["admin"] = check_rule(request)
    return render_to_response_ex(request, "setup.html", data)
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:31,代码来源:views.py


示例19: update

def update(request, id=None):
    data = dict()
    if not request.user.is_authenticated():
        return HttpResponseRedirect("/")
    
    data = dict()
    error = ""
    status = False
    form = forms.CheckKpp(request.POST)
    if form.is_valid():
        name = form.cleaned_data["name"]
        location = form.cleaned_data.get("location", "")    
        if id:
            kpp = models.Kpp.objects.filter(id=int(id))
            if kpp: 
                kpp.update(name=name, location=location)
            else:
                models.Kpp.objects.create(name=name, location=location)
        else:
            models.Kpp.objects.create(name=name, location=location)

    else: 
        error = form.errors
        data["error"] = error
        return render_to_response_ex(request, "kpp_form.html", data)
    
    return HttpResponseRedirect(reverse("kpp_list", args=[]))
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:27,代码来源:views.py


示例20: getPageUsers

def getPageUsers(request):
    form = UsersForm(request.REQUEST, request.FILES)
    users = getUsersList()
    data = dict()
    data['all_users'] = len(users)
    data.update(getDefaultParams(request, 'settings_web_api'))
    if form.is_valid():
        filter_str = form.cleaned_data["filter"]

        #выбор пользователей, содержащих в логине или ip листе строку filter_str        
        if filter_str:  
            users = filter(lambda x: x["login"].lower().find(filter_str.lower()) >= 0 or 
                       len(filter(lambda ip: ip.lower().find(filter_str.lower()) >= 0, x["ip_list"])) > 0, users)
         
        #Список полей, по которым возможна сортировка
        sort_fields = ["login"]
        sorto = form.cleaned_data["sorto"]
        #сортируем
        if sorto > 0 and sorto <= len(sort_fields):
            sort = [[sort_fields[sorto - 1]]]    
            users = GlobalSortUser(users, sort, 1, up=form.cleaned_data["up"])

        data.update(form.cleaned_data)
    for user in users:
        if len(user["ip_list"]) > COL_IP_FOR_USERS_LIST:
            user["light_ip_list"] = user["ip_list"][0:COL_IP_FOR_USERS_LIST + 1] 
        else:
            user["light_ip_list"] = user["ip_list"]        
    
    data["users"] = users
    return render_to_response_ex(request, 'webapi_users.html', data, context_instance=RequestContext(request))        
开发者ID:denis-pinaev,项目名称:tmp_trash,代码行数:31,代码来源:views.py



注:本文中的videoclient.views.render_to_response_ex函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python models.SubtitleLanguage类代码示例发布时间:2022-05-26
下一篇:
Python video_models.Video类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap