本文整理汇总了Python中virtualfolder.models.VirtualFolder.get_visible_for方法的典型用法代码示例。如果您正苦于以下问题:Python VirtualFolder.get_visible_for方法的具体用法?Python VirtualFolder.get_visible_for怎么用?Python VirtualFolder.get_visible_for使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类virtualfolder.models.VirtualFolder
的用法示例。
在下文中一共展示了VirtualFolder.get_visible_for方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_vfolders
# 需要导入模块: from virtualfolder.models import VirtualFolder [as 别名]
# 或者: from virtualfolder.models.VirtualFolder import get_visible_for [as 别名]
def get_vfolders(directory, all_vfolders=False):
"""Return a list of virtual folders for this ``directory``.
The elements of the list are dictionaries which keys are populated after
in the templates.
If ``all_vfolders`` is True then all the virtual folders matching the
provided directory are returned. If not only the visible ones are returned.
"""
if all_vfolders:
return [make_vfolder_item(vf, directory.pootle_path)
for vf in VirtualFolder.get_matching_for(directory.pootle_path)]
return [make_vfolder_item(vf, directory.pootle_path)
for vf in VirtualFolder.get_visible_for(directory.pootle_path)]