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


Python Portal._getContentLink方法代码示例

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


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

示例1: _action

# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import _getContentLink [as 别名]
    def _action(self, id_treeapp, schema, id_conteudo, link,
                      add=None, edit=None, delete=None, dados={}):
        """
           Get data from content and call the fast writer 
        """
        portal = Portal(id_site=self.id_site,
                        request=self.request)

	if not dados:
            dados = portal._getContentLink({"modulo":
                   {"id_site":self.id_site , "schema":schema,
                    "id_pk":id_conteudo}})
            if not dados:
                return
            dados = dados["serialized"]()


        if schema.find("foto") >= 0:

            """
            {"atualizado_em": "04/12/2010 12:07", 
             "dados": {"destaque": [{"titulo": "", "img": "", "descricao": ""}],
                       "foto": [{"ordem": 0, "img": "ns2/...", "credito": "",
                                 "link": "javascript:void(0)",
                                 "embed": "", "thumbnail": "", "descricao": ""},...],
                       "tags": [], "id_marca": "", "titulo": "",
                       "alinhamento": "topo_esquerda", "descricao": ""},
             "nvoto": 0, "expira_em": null, "voto": 0.0, "acesso": 0,
             "comentario": 0, "publicado_em": "04/12/2010 12:02",
             "url": "javascript:void(0)", "id_conteudo": "7",
             "meta_type": "foto", "titulo": "", "creators": []}
           """
            dafast = daFastXmlFileFoto(portal=self.dados["portal"],
                                       origem=self.dados["origem"])

            self._writer(dafast=dafast,
                         port=self.dados["portal"],
                         origem=self.dados["origem"],
                         path=self.dados["path"],
                         tipoconteudo="foto",
                         id_conteudo=id_conteudo,
                         delete=delete,
                         dados=dados,
                         id_treeapp=id_treeapp,
                         get=self._getFoto,
                         getdel=self._getFotoDelete)

            if not conf_sites:
                return

            for i in portal._getTreeShared(id_site=self.id_site,
                                           id_treeapp=id_treeapp):

                if i["id_site"] != int(self.id_site):

                    try:
                        url = portal.getUrlByApp(env_site=i["id_site"],
                                                 schema=schema,
                                                 id_conteudo=id_conteudo,
                                                 exportar=1,
                                                 id_treeapp=i["id_treeapp"],
                                                 id_site_compartilhar=self.id_site,
                                                 id_tree_compartilhar=id_treeapp,
                                                 admin=1)
                    except Exception, e:
                        url = "javascript:void(0)"

                    if not url.startswith("javascript:void(0)"):
                        dados["url"] = url
                        port, origem = conf_sites.get(i["id_site"], (None, None))
                        if port and origem:

                            dafast = daFastXmlFileFoto(portal=port,
                                                       origem=origem)

                            self._writer(dafast=dafast,
                                         port=port,
                                         origem=origem,
                                         path=self.dados["path"],
                                         tipoconteudo="foto",
                                         id_conteudo="%s_%s" % (self.dados["origem"], id_conteudo),
                                         delete=delete,
                                         dados=dados,
                                         id_treeapp=id_treeapp,
                                         get=self._getFoto,
                                         getdel=self._getFotoDelete)
开发者ID:intip,项目名称:da-apps,代码行数:88,代码来源:plug.py


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