本文整理汇总了Python中tardis.apps.ands_register.publishing.PublishHandler.access_type方法的典型用法代码示例。如果您正苦于以下问题:Python PublishHandler.access_type方法的具体用法?Python PublishHandler.access_type怎么用?Python PublishHandler.access_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tardis.apps.ands_register.publishing.PublishHandler
的用法示例。
在下文中一共展示了PublishHandler.access_type方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_url
# 需要导入模块: from tardis.apps.ands_register.publishing import PublishHandler [as 别名]
# 或者: from tardis.apps.ands_register.publishing.PublishHandler import access_type [as 别名]
def get_url(self, experiment, server_url):
"""Only public experiments can show the direct link to the experiment
in the rif-cs"""
phandler = PublishHandler(experiment.id)
if experiment.public or (phandler.access_type() == publishing.PUBLIC):
return "%s/experiment/view/%s/" % (server_url, experiment.id)
示例2: can_publish
# 需要导入模块: from tardis.apps.ands_register.publishing import PublishHandler [as 别名]
# 或者: from tardis.apps.ands_register.publishing.PublishHandler import access_type [as 别名]
def can_publish(self, experiment):
phandler = PublishHandler(experiment.id)
if (not experiment.public) or (phandler.access_type() is publishing.UNPUBLISHED):
return False
return True
示例3: can_publish
# 需要导入模块: from tardis.apps.ands_register.publishing import PublishHandler [as 别名]
# 或者: from tardis.apps.ands_register.publishing.PublishHandler import access_type [as 别名]
def can_publish(self, experiment):
phandler = PublishHandler(experiment.id)
return experiment.public or (phandler.access_type() is not publishing.UNPUBLISHED)
示例4: _is_mediated
# 需要导入模块: from tardis.apps.ands_register.publishing import PublishHandler [as 别名]
# 或者: from tardis.apps.ands_register.publishing.PublishHandler import access_type [as 别名]
def _is_mediated(self, experiment):
import tardis.apps.ands_register.publishing as publishing
from tardis.apps.ands_register.publishing import PublishHandler
phandler = PublishHandler(experiment.id)
return phandler.access_type() == publishing.MEDIATED