本文整理汇总了Python中tardis.apps.ands_register.publishing.PublishHandler.custom_description方法的典型用法代码示例。如果您正苦于以下问题:Python PublishHandler.custom_description方法的具体用法?Python PublishHandler.custom_description怎么用?Python PublishHandler.custom_description使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tardis.apps.ands_register.publishing.PublishHandler
的用法示例。
在下文中一共展示了PublishHandler.custom_description方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testGetDescriptionCustom
# 需要导入模块: from tardis.apps.ands_register.publishing import PublishHandler [as 别名]
# 或者: from tardis.apps.ands_register.publishing.PublishHandler import custom_description [as 别名]
def testGetDescriptionCustom(self):
ph = PublishHandler(self.e1.id, create=True)
self.publish_data[self.custom_description_key] = self.random_custom_description
ph.update(self.publish_data)
self.assertEquals(self.random_custom_description, ph.custom_description())
self.assertEquals(ph.custom_description(), self.random_custom_description)
description = self.provider.get_description(self.e1)
self.assertEquals(description, self.random_custom_description)
示例2: get_description
# 需要导入模块: from tardis.apps.ands_register.publishing import PublishHandler [as 别名]
# 或者: from tardis.apps.ands_register.publishing.PublishHandler import custom_description [as 别名]
def get_description(self, experiment):
from tardis.apps.ands_register.publishing import PublishHandler
phandler = PublishHandler(experiment.id)
desc = phandler.custom_description()
if not desc:
desc = experiment.description
return self.format_desc(desc)
示例3: get_description
# 需要导入模块: from tardis.apps.ands_register.publishing import PublishHandler [as 别名]
# 或者: from tardis.apps.ands_register.publishing.PublishHandler import custom_description [as 别名]
def get_description(self, experiment):
phandler = PublishHandler(experiment.id)
desc = phandler.custom_description()
if not desc:
desc = experiment.description
if self._is_html_formatted(desc):
desc = html2text(desc)
desc = desc.strip()
return desc
示例4: get_description
# 需要导入模块: from tardis.apps.ands_register.publishing import PublishHandler [as 别名]
# 或者: from tardis.apps.ands_register.publishing.PublishHandler import custom_description [as 别名]
def get_description(self, experiment):
from tardis.apps.ands_register.publishing import PublishHandler
phandler = PublishHandler(experiment.id)
desc = phandler.custom_description()
if not desc:
# We do not want the abstract to be available in the description when
# no custom description is available
desc = ""
return super(AnstoRifCsProvider, self).format_desc(desc)
示例5: get_description
# 需要导入模块: from tardis.apps.ands_register.publishing import PublishHandler [as 别名]
# 或者: from tardis.apps.ands_register.publishing.PublishHandler import custom_description [as 别名]
def get_description(self, experiment):
phandler = PublishHandler(experiment.id)
desc = phandler.custom_description()
if not desc:
desc = experiment.description
return self.format_desc(desc)