本文整理汇总了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)