本文整理汇总了Python中c2cgeoportal.models.Theme.inDesktopViewer方法的典型用法代码示例。如果您正苦于以下问题:Python Theme.inDesktopViewer方法的具体用法?Python Theme.inDesktopViewer怎么用?Python Theme.inDesktopViewer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类c2cgeoportal.models.Theme
的用法示例。
在下文中一共展示了Theme.inDesktopViewer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from c2cgeoportal.models import Theme [as 别名]
# 或者: from c2cgeoportal.models.Theme import inDesktopViewer [as 别名]
def setUp(self):
from c2cgeoportal.models import DBSession, Layer, Theme
layer = Layer(name=u'__test_layer')
mobile_only_layer = Layer(name=u'__test_mobile_only_layer')
mobile_only_layer.inDesktopViewer = False
desktop_only_layer = Layer(name=u'__test_desktop_only_layer')
desktop_only_layer.inMobileViewer = False
theme = Theme(name=u'__test_theme')
theme.children = [layer, mobile_only_layer, desktop_only_layer]
theme.inMobileViewer = True
mobile_only_theme = Theme(name=u'__test_mobile_only_theme')
mobile_only_theme.children = [layer]
mobile_only_theme.inDesktopViewer = False
mobile_only_theme.inMobileViewer = True
desktop_only_theme = Theme(name=u'__test_desktop_only_theme')
desktop_only_theme.children = [layer]
desktop_only_theme.inMobileViewer = False
# the following theme should not appear in the list of themes on desktop
# nor on mobile
# It should be accessible by explicitely loading it in mobile though
mobile_private_theme = Theme(name=u'__test_mobile_private_theme')
mobile_private_theme.children = [layer]
mobile_private_theme.inDesktopViewer = False
mobile_private_theme.inMobileViewer = False
DBSession.add_all([
layer, mobile_only_layer, desktop_only_layer, theme,
mobile_only_theme, desktop_only_theme, mobile_private_theme
])
transaction.commit()