@parse_data
@set_database
def get_topic_contents(kinds=None, topic_id=None, **kwargs):
 if topic_id:
  topic_node = Item.get((Item.id == topic_id), (Item.kind == 'Topic'))
  if (not kinds):
   kinds = ['Video', 'Audio', 'Exercise', 'Document']
  return Item.select(Item).where(Item.kind.in_(kinds), Item.path.contains(topic_node.path))

@ parse_data @ set_database def get_topic_contents ( kinds = None , topic_id = None , ** kwargs ) : if topic_id : topic_node = Item . get ( ( Item . id == topic_id ) , ( Item . kind == 'Topic' ) ) if ( not kinds ) : kinds = [ 'Video' , 'Audio' , 'Exercise' , 'Document' ] return Item . select ( Item ) . where ( Item . kind . in_ ( kinds ) , Item . path . contains ( topic_node . path ) )
convenience function for returning a set of content/leaf nodes contained within a topic .