本文整理汇总了Python中pushmaster.taglib.T.script方法的典型用法代码示例。如果您正苦于以下问题:Python T.script方法的具体用法?Python T.script怎么用?Python T.script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pushmaster.taglib.T
的用法示例。
在下文中一共展示了T.script方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: render_doc
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import script [as 别名]
def render_doc(self, current_user, push, pending_requests):
doc = common.Document(title='pushmaster: push: ' + logic.format_datetime(push.ptime))
requests = query.push_requests(push)
push_div = self.render_push_div(current_user, push, requests, pending_requests)
doc.body(push_div)
doc.body(common.jquery_js, common.jquery_ui_js, common.pushmaster_js, common.script('/js/push.js'))
push_json = ScriptCData('this.push = %s;' % json.dumps(dict(key=str(push.key()), state=push.state)))
doc.head(T.script(type='text/javascript')(push_json))
return doc
示例2: render_doc
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import script [as 别名]
def render_doc(self, push, current_user, pending_requests):
doc = common.Document(title='pushmaster: push: %s %s' % (util.format_datetime(push.ptime), push.name))
doc.funcbar(T.span('|', class_='sep'), common.push_email(push, 'Send Mail to Requesters'))
requests = query.push_requests(push)
push_div = self.render_push_div(current_user, push, requests, pending_requests)
doc.body(push_div)
doc.scripts(common.script('/js/push.js'))
push_json = ScriptCData('this.push = %s;' % json.dumps(dict(key=str(push.key()), state=push.state)))
doc.head(T.script(type='text/javascript')(push_json))
return doc
示例3: script
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import script [as 别名]
def script(src, external=False):
return T.script(type='text/javascript', src=src if external else urls.static_url(src))