Skip to content

Commit

Permalink
Merge pull request #195 from wlorenzetti/master
Browse files Browse the repository at this point in the history
Add custom fields to tree utils function for custom Tree model.
  • Loading branch information
idlesign committed Sep 16, 2018
2 parents ee43d35 + ef5170a commit bdc41b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sitetree/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ def generate_id_for(obj):
return id(obj)


def tree(alias, title='', items=None):
def tree(alias, title='', items=None, **kwargs):
"""Dynamically creates and returns a sitetree.
:param str|unicode alias:
:param str|unicode title:
:param iterable items: dynamic sitetree items objects created by `item` function.
:rtype: TreeBase
"""
tree_obj = get_tree_model()(alias=alias, title=title)
tree_obj = get_tree_model()(alias=alias, title=title, **kwargs)
tree_obj.id = generate_id_for(tree_obj)
tree_obj.is_dynamic = True

Expand Down

0 comments on commit bdc41b9

Please sign in to comment.