当前位置: 首页>>代码示例>>Python>>正文


Python router.to_path函数代码示例

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


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

示例1: index

def index(_write_tmpl, ret_path='/'):
    g_path = router.to_path(google.index, ret_path=ret_path)
    dct = {'login_google_path': users.create_login_url(g_path),
           'login_passwordless_path': router.to_path(enviar_email,ret_path=ret_path),
           'login_facebook_path': router.to_path(facebook.index,ret_path=ret_path),
           'faceapp': facade.get_facebook_app_data().execute().result}
    _write_tmpl('login/home.html', dct)
开发者ID:renzon,项目名称:livrogae,代码行数:7,代码来源:home.py

示例2: index

def index(_logged_user):
    if not _logged_user.email == '[email protected]':
        return RedirectResponse('/erro')
    return TemplateResponse({'security_table_path': router.to_path(permission_home.index),
                             'permission_admin_path': router.to_path(admin),
                             'passwordless_admin_path': router.to_path(passwordless.form),
                             'facebook_admin_path': router.to_path(facebook.form)})
开发者ID:cicerocasj,项目名称:Catequizando,代码行数:7,代码来源:home.py

示例3: index

def index(ret_path='/'):
    g_path = router.to_path(google.index, ret_path=ret_path)
    dct = {'login_google_path': users.create_login_url(g_path),
           'login_passwordless_path': router.to_path(send_email, ret_path=ret_path),
           'login_facebook_path': router.to_path(facebook.index, ret_path=ret_path),
           'faceapp': facade.get_facebook_app_data().execute().result}
    return TemplateResponse(dct, 'login/home.html')
开发者ID:Marrary2,项目名称:tekton,代码行数:7,代码来源:home.py

示例4: index

def index(_write_tmpl, _usuario_corrente):
    salvar_path = router.to_path(salvar)
    query = Curso.query_encontrar_cursos_de_usuario(_usuario_corrente.key)
    cursos = query.fetch()
    for c in cursos:
        c.detalhar_path = router.to_path(detalhar, c.key.id())
    _write_tmpl('curso_home.html', {'cursos': cursos, 'salvar_path': salvar_path})
开发者ID:renzon,项目名称:fatecscript,代码行数:7,代码来源:home.py

示例5: index

def index(_logged_user):
    """
    This is a example of file upload using
    Google Cloud Storage
    :return:
    """
    success_url = router.to_path(upload)
    bucket = get_default_gcs_bucket_name()
    logging.info(bucket)
    url = blobstore.create_upload_url(success_url, gs_bucket_name=bucket)
    cmd = blob_facade.list_blob_files_cmd(_logged_user)
    blob_form = blob_facade.blob_file_form()
    deletar_path_base = router.to_path(delete)
    download_path_base = router.to_path(download)

    def localizar_blob(blob):
        dct = blob_form.fill_with_model(blob, 64)
        dct['delete_path'] = router.to_path(deletar_path_base, dct['id'])
        dct['download_path'] = router.to_path(download_path_base, blob_key=blob.blob_key, filename=dct['filename'])
        return dct

    blob_files = [localizar_blob(b) for b in cmd()]
    context = {'upload_url': url,
               'blob_files': blob_files}
    return TemplateResponse(context, 'updown/home.html')
开发者ID:faahbih,项目名称:projetoolivarts,代码行数:25,代码来源:home.py

示例6: index

def index(_write_tmpl):
    query = Curso.query_ordenada_por_nome()
    cursos = query.fetch()
    dct = {'lista_cursos': cursos,
           'matricula_url': router.to_path(matricula),
           'salvar_url': router.to_path(salvar)}
    _write_tmpl('/templates/curso_home.html', dct)
开发者ID:renzon,项目名称:livrogae,代码行数:7,代码来源:curso.py

示例7: test_querystring

 def test_querystring(self):
     query_string = {'foo': 'bar'}
     self.assertEqual("/pack?foo=bar", router.to_path(pack, **query_string))
     query_string = {'foo': 'bar', 'param': 1}
     self.assertEqual("/pack?foo=bar&param=1", router.to_path(pack, **query_string))
     query_string = {'foo': 'çáê', 'param': 1}
     self.assertEqual("/pack?foo=%C3%A7%C3%A1%C3%AA&param=1", router.to_path(pack, **query_string))
开发者ID:bboymph,项目名称:tekton,代码行数:7,代码来源:router_tests.py

示例8: busca_produtos

def busca_produtos(_logged_user, busca):
    cmd = facade.list_observacoes_cmd()
    observacoes = cmd()
    busca = slugify(busca)
    pesquisa = Observacoe.query(Observacoe.busca >= busca).order(Observacoe.busca)

    get_dono_cmd_lista=[GetDonoObs(o) for o in observacoes]
    paralelo=CommandParallel(*get_dono_cmd_lista)
    paralelo()

    edit_path = router.to_path(edit)
    delete_path = router.to_path(delete)
    short_form = facade.observacoe_short_form()

    def short_observacoe_dict(observacoe):
        observacoe_dct = short_form.fill_with_model(observacoe)
        observacoe_dct['edit_path'] = router.to_path(edit_path, observacoe_dct['id'])
        observacoe_dct['delete_path'] = router.to_path(delete_path, observacoe_dct['id'])
        return observacoe_dct


    short_observacoes = [short_observacoe_dict(observacoe) for observacoe in observacoes]
    for observacao,dono_comando in zip(short_observacoes,get_dono_cmd_lista):
        observacao['dono_flag']=(dono_comando.result ==_logged_user)
    context = {'observacoe': short_observacoes,
               'new_path': router.to_path(new),
               'observacoes': pesquisa.fetch()
               }
    return TemplateResponse(context, router.to_path('observacoes/admin/home.html'))
开发者ID:vinicius-carvalho,项目名称:fatec-prog-script,代码行数:29,代码来源:home.py

示例9: index

def index(_logged_user, _handler, **catequizando_properties):
    access_denid = validate_permission(COORDENADOR, _logged_user)
    if access_denid:
        return access_denid
    if catequizando_properties.get("files"):
        blob_infos = _handler.get_uploads("files[]")
        blob_key = blob_infos[0].key()
        avatar = to_path(download, blob_key)
        catequizando_properties["avatar"] = avatar
        catequizando_properties.pop("files", None)
    cmd = catequizando_facade.save_catequizando_cmd(**catequizando_properties)
    user_not_unique = False
    try:
        if catequizando_properties.get('username') and User.is_unique(catequizando_properties.get('username')):
            cmd()
        else:
            user_not_unique = True
    except CommandExecutionException:
        context = {'errors': cmd.errors,
                   'catechized': catequizando_properties}
        return TemplateResponse(context, '/catequizandos/catequizando.html')
    if user_not_unique:
        cmd.errors['username'] = unicode(u'Usuário já existe.')
        context = {'errors': cmd.errors,
                   'catechized': catequizando_properties}
        return TemplateResponse(context, '/catequizandos/catequizando.html')
    sleep(0.5)
    return RedirectResponse(router.to_path(catequizandos))
开发者ID:cicerocasj,项目名称:Catequizando,代码行数:28,代码来源:upload.py

示例10: to_dict

 def to_dict(self):
     dct = super(Participante, self)._to_dict()
     id = self.key.id()
     dct['id'] = id
     dct['deletarPath'] = router.to_path(deletar, id)
     dct['editarPath'] = router.to_path(editar, id)
     return dct
开发者ID:renzon,项目名称:angular,代码行数:7,代码来源:rest.py

示例11: localize_blob_file

 def localize_blob_file(blob_file):
     blob_file_dct = blob_file_form.fill_with_model(blob_file, 64)
     blob_file_dct['delete_path'] = router.to_path(delete_path, blob_file_dct['id'])
     blob_file_dct['download_path'] = router.to_path(download_path,
                                                     blob_file.blob_key,
                                                     blob_file_dct['filename'])
     return blob_file_dct
开发者ID:renzon,项目名称:appengineepython,代码行数:7,代码来源:home.py

示例12: index

def index():
    context = {
        'salvar_path': router.to_path(rest.save),
        'deletar_path': router.to_path(rest.delete),
        'editar_path': router.to_path(rest.update),
        'listar_path': router.to_path(rest.index)}
    return TemplateResponse(context)
开发者ID:SamaraCardoso27,项目名称:eMakeup,代码行数:7,代码来源:home.py

示例13: index

def index():
    comando = blob_facade.list_blob_files_cmd()
    arquivos = comando()
    download_path = to_path(download)
    for arq in arquivos:
        arq.download_path=to_path(download_path, arq.key.id(), arq.filename)
    ctx = {'arquivos': arquivos}
    return TemplateResponse(ctx, template_path="/updown_home.html")
开发者ID:joaocarlos1994,项目名称:tekton,代码行数:8,代码来源:updown.py

示例14: index

def index():
    context = {
        'admin_path': router.to_path(admin),
        'salvar_path': router.to_path(rest.save),
        'editar_path': router.to_path(rest.update),
        'apagar_path': router.to_path(rest.delete),
        'listar_path': router.to_path(rest.index)}
    return TemplateResponse(context, 'books/home.html')
开发者ID:renzon,项目名称:fatec-script-2,代码行数:8,代码来源:home.py

示例15: logar

def logar(_handler, _resp, username, passwd):
    found = User.get_by_username_and_pw(username.strip(), passwd)
    if not found:
        _handler.redirect(router.to_path(site_index) + "?errors=loggin_error")
    
    else:
        token = "%s%s" % (username, AUTH_TOKEN)
        _resp.set_cookie('logged_user', str(found.key.id()))
        _handler.redirect(router.to_path(site_index))
开发者ID:giovaneliberato,项目名称:keepfamily,代码行数:9,代码来源:usuario.py


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