docs: def delete_template(template_id,**kwargs):
      """
          Delete a template and its type and typeattrs.
      """
      try:
          tmpl = db.DBSession.query(Template).filter(Template.id==template_id).one()
      except NoResultFound:
          raise ResourceNotFoundError("Template %s not found"%(template_id,))
      db.DBSession.delete(tmpl)
      db.DBSession.flush()
      return 'OK'