本文整理汇总了Python中publica.core.portal.Portal.renderLink方法的典型用法代码示例。如果您正苦于以下问题:Python Portal.renderLink方法的具体用法?Python Portal.renderLink怎么用?Python Portal.renderLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类publica.core.portal.Portal
的用法示例。
在下文中一共展示了Portal.renderLink方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getProgramaNoAr
# 需要导入模块: from publica.core.portal import Portal [as 别名]
# 或者: from publica.core.portal.Portal import renderLink [as 别名]
def getProgramaNoAr(self, limit):
"""
Retorna para o portlet os programas que estão no ar e os proximos
"""
portal = Portal(id_site=self.id_site, request=self.request)
from datetime import datetime, date, time
today = datetime.now()
hora_atual = str(today.hour)+":"+str(today.minute)
data_atual = str(today.date())
res = []
for i in self.execSql("select_programas_no_ar",
hora_atual=hora_atual,
data_atual=data_atual,
limit=int(limit)):
if i["link"]:
the_link = portal.renderLink(dados=i["link"],
exportar=1,
render=1)
if "[target" in the_link:
i['link_target'] = the_link.split("[target")[1].replace("]", "")
i['link'] = the_link.split("[target")[0]
else:
i["link"] = the_link
res.append(i)
return res