def keyword_widget(node, kw): tree = {} for name, content_type in core.SEARCHABLE_CONTENTS.items(): tree.update({name: get_attr_tree(content_type=content_type)}) tree = json.dumps(tree) return KeywordsTreeWidget(source_tree=tree, )
def keyword_widget(node, kw): request = node.bindings['request'] levels = request.get_site_folder.get_tree_nodes_by_level() level = len(levels) return KeywordsTreeWidget(min_len=1, max_len=level, can_create=level + 1, levels=levels)
def keyword_widget(node, kw): request = node.bindings['request'] root = request.root levels = root.get_tree_nodes_by_level() return KeywordsTreeWidget(can_rename=False, min_len=2, max_len=DEFAULT_TREE_LEN, can_create=1000, levels=levels)
def keyword_widget(node, kw): root = getSite() can_create = 0 levels = root.get_tree_nodes_by_level() return KeywordsTreeWidget( min_len=1, max_len=DEFAULT_TREE_LEN, can_create=can_create, levels=levels)
def keyword_widget(node, kw): request = node.bindings['request'] root = request.root can_create = 0 levels = root.get_tree_nodes_by_level() return KeywordsTreeWidget(min_len=1, max_len=DEFAULT_TREE_LEN, can_create=can_create, levels=levels)
def keyword_widget(node, kw): can_create = 0 root = getSite() values = root.get_tree_nodes_by_level() if values: values = values[1:] return KeywordsTreeWidget(min_len=1, max_len=DEFAULT_TREE_LEN, can_create=can_create, levels=values)
def keyword_widget(node, kw): request = node.bindings['request'] site = request.get_site_folder can_create = 0 if has_role(role=('Member', )): can_create = 1 if has_any_roles(roles=('Admin', ('SiteAdmin', site))): can_create = 0 levels = site.get_tree_nodes_by_level() return KeywordsTreeWidget( min_len=2, max_len=DEFAULT_TREE_LEN, can_create=can_create, levels=levels)