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


Python Portal.getUrlByApp方法代码示例

本文整理汇总了Python中publica.core.portal.Portal.getUrlByApp方法的典型用法代码示例。如果您正苦于以下问题:Python Portal.getUrlByApp方法的具体用法?Python Portal.getUrlByApp怎么用?Python Portal.getUrlByApp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在publica.core.portal.Portal的用法示例。


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

示例1: getConteudoBusca

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
 def getConteudoBusca(self, regiao=None, categoria=None):
     """
         Returns the results of an establishment search
     """
     lista = []
     portal = Portal(id_site=self.id_site, request=self.request)
     if regiao == "todas" and categoria == "todas":
         for i in self.execSql("select_busca"):
             i["url"] = portal.getUrlByApp(env_site=self.id_site,
                                           schema=self.schema,
                                           id_conteudo=i["id_conteudo"],
                                           exportar=1,
                                           admin=1,
                                           mkattr=1)
             lista.append(i)
         return lista
     elif regiao == "todas":
         for i in self.execSql("select_busca_categoria", 
                                 categoria=categoria):
             i["url"] = portal.getUrlByApp(env_site=self.id_site,
                                           schema=self.schema,
                                           id_conteudo=i["id_conteudo"],
                                           exportar=1,
                                           admin=1,
                                           mkattr=1)
             lista.append(i)
             return lista
     elif categoria == "todas":
         for i in self.execSql("select_busca_regiao", 
                                 regiao=regiao):
             i["url"] = portal.getUrlByApp(env_site=self.id_site,
                                           schema=self.schema,
                                           id_conteudo=i["id_conteudo"],
                                           exportar=1,
                                           admin=1,
                                           mkattr=1)
             lista.append(i)
             return lista
     else:
         for i in self.execSql("select_busca_completa",
                                 regiao=regiao, 
                                 categoria=categoria):
             i["url"] = portal.getUrlByApp(env_site=self.id_site,
                                           schema=self.schema,
                                           id_conteudo=i["id_conteudo"],
                                           exportar=1,
                                           admin=1,
                                           mkattr=1)
             lista.append(i)
             return lista
开发者ID:intip,项目名称:da-apps,代码行数:52,代码来源:site.py

示例2: _maisUltimasApp

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
    def _maisUltimasApp(self, limit=50, offset=0, exportar=None,
                              dt=1, render=None, samesite=None):
        """
        """
        portal = Portal(id_site=self.id_site,
                        request=self.request)

        exportar = self.request.get("exportar") or exportar
 
        res = {"qtde":0, "res":[]} 
        for i in self.execSql("select_ultimas_app",
                              schema=self.schema,
                              limit=int(limit),
                              offset=int(offset)):

            i["url"] = portal.getUrlByApp(env_site=self.id_site,
                                          schema=self.schema,
                                          id_conteudo=i["id_conteudo"],
                                          exportar=exportar,
                                          admin=render,
                                          samesite=samesite)
            if dt:
                i["datetime"] = lambda t, i=i["publicado_em"]:strftime(t, 
                                               strptime(i, "%Y-%m-%d %H:%M:%S"))
            res["res"].append(i)

        res["qtde"] = self.execSql("select_ultimas_app_qtde",
                                   schema=self.schema).next()["qtde"]

        return res
开发者ID:intip,项目名称:da-apps,代码行数:32,代码来源:public.py

示例3: _setDados

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
    def _setDados(self, id_conteudo):
        """
        
        """
        for conteudo in self.execSql("select_conteudo_dados",
                                     id_conteudo=int(id_conteudo)):
            portal = Portal(id_site=self.id_site,
                            request=self.request)
            tags = ""
            url = portal.getUrlByApp(env_site=self.id_site,
                                     schema=self.schema,
                                     id_conteudo=id_conteudo,
                                     exportar=1,
                                     admin=1,
                                     mkattr=1)

            dados = {"titulo":conteudo["titulo"],
                     "expira_em":conteudo["expira_em"],
                     "publicado_em":conteudo["publicado_em"],
                     "publicado":conteudo["publicado"],
                     "imagem":conteudo["imagem"],
                     "filiado":conteudo["filiado"],
                     "descricao":conteudo["descricao"],
                     "imagem_destaque":conteudo["imagem_destaque"],
                     "titulo_destaque":conteudo["titulo_destaque"],
                     "descricao_destaque":conteudo["descricao_destaque"],
                     "tags":tags}
            return dados
开发者ID:intip,项目名称:da-apps,代码行数:30,代码来源:app.py

示例4: getCinemasCidade

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
 def getCinemasCidade(self, nome_cidade):
     """
     """
     cinemas = []
     for i in self.execSql("select_cinema_nome_cidade",
                            nome_cidade=nome_cidade):
         portal = Portal(id_site=self.id_site,
                         request=self.request)
         i['url'] = portal.getUrlByApp(env_site=self.id_site, schema=self.schema, id_conteudo=i['id_conteudo'], exportar=1, admin=1)
         cinemas.append(i)
     return cinemas
开发者ID:intip,项目名称:da-apps,代码行数:13,代码来源:public.py

示例5: _setDados

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
    def _setDados(self, id_conteudo):
        """
            Método padrão que encapsula os dados de um conteúdo
        """
        portal = Portal(id_site=self.id_site,
                        request=self.request)

        for i in self.execSql("select_dados",
                              id_conteudo=int(id_conteudo)):

            tags = [j["tag"] for j in portal._getTags(
                                   id_site=self.id_site,
                                   id_conteudo=id_conteudo,
                                   schema=self.schema,
                                   text=None)]
            dados = {"titulo":i["titulo"],
                     "editor":i["editor"],
                     "calendario":i["calendario"],
                     "foto_galeria":i["foto_galeria"],
                     "foto_interna":i["foto_interna"],
                     "legenda_foto_interna":i["legenda_foto_interna"],
                     "destaque_capa":i["destaque_capa"],
                     "andamento":i["andamento"],
                     "cadastros":[],
                     "destaque":[],
                     "tags":tags}

            dados["destaque"].append({"titulo":i["titulo_destaque"],
                                      "descricao":i["descricao_destaque"],
                                      "img":i["imagem_destaque"]})
                
            for j in self.execSql("select_conteudo_cadastros",
                                  id_conteudo=int(id_conteudo)):
                dados["cadastros"].append(j)

            url = portal.getUrlByApp(env_site=self.id_site,
                                     schema=self.schema,
                                     id_conteudo=id_conteudo,
                                     exportar=1,
                                     admin=1,
                                     mkattr=1)

            return {"titulo":i["titulo"],
                    "meta_type":self.meta_type,
                    "id_conteudo":id_conteudo,
                    "publicado_em":i["publicado_em"],
                    "expira_em":i["expira_em"],
                    "atualizado_em":i["atualizado_em"],
                    "url":url,
                    "creators":[],
                    "dados":dados
                    }

        return {}
开发者ID:opovo,项目名称:OPovo-aplicativos,代码行数:56,代码来源:app.py

示例6: getLastNewsDate

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
 def getLastNewsDate(self, hash):
     """
         Returns the data of the last news in the folder with hash=hash
     """
     portal = Portal(id_site=self.id_site,
                     request=self.request)
     for i in self.execSql("select_last_date_by_hash", hash=hash):
         i["url"] = portal.getUrlByApp(env_site=self.id_site,
                                       schema=self.schema,
                                       id_conteudo=i["id_conteudo"],
                                       mkattr=0)
         yield i
开发者ID:intip,项目名称:da-apps,代码行数:14,代码来源:public.py

示例7: getAnjo

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
 def getAnjo(self, dia, mes):
     """
         Calcula o anjo para um dia do ano
     """
     url="404"
     for i in self.execSql("select_por_titulo", data=str("2013"+"-"+mes+"-"+dia)):
         portal = Portal(id_site=self.id_site, request=self.request)
         url = portal.getUrlByApp(env_site=self.id_site,
                                           schema=self.schema,
                                           id_conteudo=i["id_conteudo"],
                                           exportar=1,
                                           admin=1,
                                           mkattr=1)
     return url
开发者ID:intip,项目名称:da-apps,代码行数:16,代码来源:site.py

示例8: getSorte

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
 def getSorte(self):
     """
         Seleciona um item aleatorio
     """
     url = "404"
     for i in self.execSql("select_sorte"):
         portal = Portal(id_site=self.id_site, request=self.request)
         url = portal.getUrlByApp(env_site=self.id_site,
                                           schema=self.schema,
                                           id_conteudo=i["id_conteudo"],
                                           exportar=1,
                                           admin=1,
                                           mkattr=1)
     return url
开发者ID:intip,项目名称:da-apps,代码行数:16,代码来源:site.py

示例9: getFilmesBySessaoJson

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
 def getFilmesBySessaoJson(self):
     """
     """
     data = datetime.now()
     data = str(data.date())
     portal = Portal(id_site=self.id_site,
                     request=self.request)
     dadosapp = portal._getApp(env_site=self.id_site,
                               schema=self.schema)["dados"]
     filmes =[]
     for i in self.execSql("select_filmes_sessoes",
                           SCHEMA=buffer(dadosapp['auth_schema']),
                           data_atual=data):
         i['url'] = portal.getUrlByApp(env_site=self.id_site, schema=dadosapp['auth_schema'], id_conteudo=i['id_conteudo'], exportar=1,admin=1)
         filmes.append(i)
     return filmes
开发者ID:intip,项目名称:da-apps,代码行数:18,代码来源:public.py

示例10: getCidadeCinemaDict

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
 def getCidadeCinemaDict(self):
     """
     """
     cidades_cinema = {}        
     for i in self.execSql("select_cidades"):
         dados_cine = []
         for j in self.execSql("select_cinema_cidade",
                                id_cidade=int(i['id_cidade'])):
             portal = Portal(id_site=self.id_site,
                             request=self.request)
             j['url'] = portal.getUrlByApp(env_site=self.id_site, schema=self.schema, id_conteudo=j['id_conteudo'], exportar=1,admin=1)
             dados = {"id_conteudo":j["id_conteudo"],
                      "titulo":j["titulo"],
                      "url":j["url"]}
             dados_cine.append(dados)
         cidades_cinema[i["nome"]] = dados_cine 
     return cidades_cinema                                        
开发者ID:intip,项目名称:da-apps,代码行数:19,代码来源:public.py

示例11: getranking

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
 def getranking(self, modelo=None, limit=20, offset=0):
     """
         Retorna as avaliações filtrado ou não pelo modelo
     """
     portal = Portal(self.id_site, self.request)
     lr = self._listranking(modelo=modelo, limit=limit, offset=offset)
     res = []
     for i in lr:
         #i["imagem"] = portal.getUrlByFile(source=i["imagem"] )
         i["url"] = portal.getUrlByApp(env_site=self.id_site,
                                       schema=self.schema,
                                       id_conteudo=i["id_conteudo"],
                                       render=True,
                                       admin=1,
                                       exportar=1)
         res.append(i)
     
     return res
开发者ID:intip,项目名称:da-apps,代码行数:20,代码来源:site.py

示例12: _UltimasApp

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
    def _UltimasApp(self, limit=50, offset=0, exportar=None):
        """
        """
        portal = Portal(id_site=self.id_site,
                        request=self.request)

        exportar = self.request.get("exportar") or exportar

        for i in self.execSql("select_ultimas_app",
                              schema=self.schema,
                              limit=int(limit),
                              offset=int(offset)):

            i["url"] = portal.getUrlByApp(env_site=self.id_site,
                                          schema=self.schema,
                                          id_conteudo=i["id_conteudo"],
                                          exportar=exportar)
            yield i
开发者ID:intip,项目名称:da-apps,代码行数:20,代码来源:public.py

示例13: _getDates

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
    def _getDates(self):
        """
            return all content with date (YYYY-MM-DD)
        """
        portal = Portal(id_site=self.id_site,
                        request=self.request)

        for i in self.execSql("select_dates",
                              schema=self.schema):
 

            i["url"] = portal.getUrlByApp(env_site=self.id_site,
                                          schema=self.schema,
                                          id_conteudo=i["id_conteudo"],
                                          url=i["url"],
                                          id_treeapp=i["id_treeapp"])

            yield i
开发者ID:intip,项目名称:da-apps,代码行数:20,代码来源:site.py

示例14: getPar

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
 def getPar(self, bom=[], ruim=[]):
     lista = set()
     for i in bom:
         for j in self.execSql("select_nome", id_caracteristica=i):
             lista.add(j["id_conteudo"])
     for i in ruim:
         for j in self.execSql("select_nome", id_caracteristica=i):
             if j["id_conteudo"] in lista and len(lista) > 1:
                 lista.remove(j["id_conteudo"])
     for i in lista:
         portal = Portal(id_site=self.id_site, request=self.request)
         url = portal.getUrlByApp(env_site=self.id_site,
                                           schema=self.schema,
                                           id_conteudo=i,
                                           exportar=1,
                                           admin=1,
                                           mkattr=1)
         for i in self.execSql("select_titulo", id_conteudo=i):
             return {"url":url, "nome":i["titulo"]}
     return "404"
开发者ID:intip,项目名称:da-apps,代码行数:22,代码来源:site.py

示例15: getVideosSite

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import getUrlByApp [as 别名]
    def getVideosSite(self, tags, limit=50, offset=0, serialize=None):
        """Retorna videos se tiverem alguma tag
        """
        qtde = 0
        items = 0
        tags = tags.strip().split(" ")
        portal = Portal(id_site=self.id_site, request=self.request)
        if tags:
            has = False
            for tag in tags:
                has = True
                self.execSqlBatch("select_videos_count",
                                  tag=tag)
            if has:
                for i in self.execSqlUnion():
                    qtde += i["qtde"]

            for tag in tags:
                self.execSqlBatch("select_videos",
                                  tag=tag,
                                  limit=int(limit),
                                  offset=int(offset))
            items = self.execSqlUnion(order="sea_id DESC", limit=int(limit),
                                                           offset=int(offset))
        copia = items
        if serialize:
            items = [i for i in items]
            for i in items:
                comm = portal._getComentarios(env_site=self.id_site,
                                              schema=self.schema,
                                              id_conteudo=i["id_conteudo"])
                comm = [j for j in comm]
                i["comm"] = comm
                i["url"] = portal.getUrlByApp(env_site=self.id_site,
                                              schema=self.schema,
                                              id_conteudo=i["id_conteudo"],
                                              exportar=1,
                                              admin=1)
            return {"qtde":qtde, "items":items}

        return {"qtde":qtde, "items":items}
开发者ID:intip,项目名称:da-apps,代码行数:43,代码来源:site.py


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