本文整理汇总了Python中publica.core.portal.Portal._getComentarios方法的典型用法代码示例。如果您正苦于以下问题:Python Portal._getComentarios方法的具体用法?Python Portal._getComentarios怎么用?Python Portal._getComentarios使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类publica.core.portal.Portal
的用法示例。
在下文中一共展示了Portal._getComentarios方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getVideo
# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import _getComentarios [as 别名]
def getVideo(self, sea_id):
"""Retorna o video selecionado
"""
item = self.execSql("select_video",
sea_id=int(sea_id)).next()
portal = Portal(id_site=self.id_site, request=self.request)
comm = portal._getComentarios(env_site=self.id_site,
schema=self.schema,
id_conteudo=item["id_conteudo"])
comm = [j for j in comm]
item["comm"] = comm
return {"item":item}
示例2: getVideosSite
# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import _getComentarios [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}