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

Python router.to_path函数代码示例

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

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



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


示例16: upload

def upload(_handler, **jogos_properties):
    if jogos_properties.get('files'):
        blob_infos = _handler.get_uploads("files[]")
        blob_key = blob_infos[0].key()
        avatar = router.to_path(download, blob_key)
        cmd = Game.get_by_id(long(jogos_properties['id']))
        cmd.foto = avatar
        cmd.put()
        return RedirectResponse(router.to_path(index))
开发者ID:rodrigomalk,项目名称:Novos-Bandeirantes,代码行数:9,代码来源:gerenciar.py


示例17: 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)
开发者ID:JeffreiToledo,项目名称:Projeto_Script,代码行数:9,代码来源:home.py


示例18: teleportToReview

def teleportToReview(app_id, **kwargs):
    review_form = ReviewForm()
    review = Review()
    review.app = app_id
    review_form.fill_with_model(review)
    contexto = {'salvar_path': router.to_path(reviewss.form.salvar),
                'reviews': review_form,
                'admin_path': router.to_path(admin)}
    return TemplateResponse(contexto, 'reviewss/form.html')
开发者ID:seijiakiyama,项目名称:fatec-script,代码行数:9,代码来源:form.py


示例19: edit_form

def edit_form(review_id):
    review_id = int(review_id)
    review = Review.get_by_id(review_id)
    review_form = ReviewForm()
    review_form.fill_with_model(review)
    contexto = {'salvar_path': router.to_path(editar, review_id),
                'reviews': review_form,
                'admin_path': router.to_path(admin)}
    return TemplateResponse(contexto, 'reviewss/form.html')
开发者ID:seijiakiyama,项目名称:fatec-script,代码行数:9,代码来源:form.py


示例20: listar

def listar():
    query = Escravo.query().order(-Escravo.name)
    escravos = query.fetch()
    form_short = EscravoFormShort()
    escravos = [form_short.fill_with_model(e) for e in escravos]
    for e in escravos:
        e["edit_path"] = router.to_path(edit_form, e["id"])
        e["delete_path"] = router.to_path(deletar, e["id"])
    contexto = {"escravos": escravos}
    return TemplateResponse(contexto)
开发者ID:renzon,项目名称:fatec-script,代码行数:10,代码来源:db.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python util.is_string函数代码示例发布时间:2022-05-27
下一篇:
Python character.Character类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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