code: def _get_category_from_pars_var(template_var, context):
      '''
      get category from template variable or from tree_path
      '''
      cat = template_var.resolve(context)
      if isinstance(cat, basestring):
          cat = Category.objects.get_by_tree_path(cat)
      return caf _get_category_from_pars_var(template_var, context):
      '''
      get category from template variable or from tree_path
      '''
      cat = template_var.resolve(context)
      if isinstance(cat, basestring):
          cat = Category.objects.get_by_tree_path(cat)
      return cat
docs: get category from template variable or from tree_path