@register.filter
def tree_info(items, features=None):
 kwargs = {}
 if features:
  feature_names = features.split(u',')
  if (u'ancestors' in feature_names):
   kwargs[u'ancestors'] = True
 return tree_item_iterator(items, **kwargs)

@ register . filter def tree_info ( items , features = None ) : kwargs = { } if features : feature_names = features . split ( u',' ) if ( u'ancestors' in feature_names ) : kwargs [ u'ancestors' ] = True return tree_item_iterator ( items , ** kwargs )
given a list of tree items .