docs: def update_templatetype(templatetype,**kwargs):
      """
          Update a resource type and its typeattrs.
          New typeattrs will be added. typeattrs not sent will be ignored.
          To delete typeattrs, call delete_typeattr
      """
  
      tmpltype_i = db.DBSession.query(TemplateType).filter(TemplateType.id == templatetype.id).one()
  
      _update_templatetype(templatetype, tmpltype_i)
  
      db.DBSession.flush()
  
      return tmpltype_i