@set_database
def get_topic_node(content_id=None, topic=True, **kwargs):
 if content_id:
  if topic:
   kind_selector = (Item.kind == 'Topic')
  else:
   kind_selector = (Item.kind != 'Topic')
  value = Item.select(Item.title, Item.description, Item.available, Item.kind, Item.children, Item.id, Item.path, Item.slug).where(((Item.id == content_id) & kind_selector)).get()
  return model_to_dict(value)

@ set_database def get_topic_node ( content_id = None , topic = True , ** kwargs ) : if content_id : if topic : kind_selector = ( Item . kind == 'Topic' ) else : kind_selector = ( Item . kind != 'Topic' ) value = Item . select ( Item . title , Item . description , Item . available , Item . kind , Item . children , Item . id , Item . path , Item . slug ) . where ( ( ( Item . id == content_id ) & kind_selector ) ) . get ( ) return model_to_dict ( value )
convenience function for returning a topic/content node with limited fields .