parameters: (left_class=None, right_class=None,
                                left_type=None, left_id=None,
                                right_type=None, right_id=None,
                                rel_type=None, rel_date=None,
                                new_type=None,analyst=None)
return_statement: return results
docstring: Update the relationship type between two top-level objects.
  
      :param left_class: The first top-level object.
      :type left_class: :class:`crits.core.crits_mongoengine.CritsBaseAttributes`
      :param right_class: The second top-level object.
      :type right_class: :class:`crits.core.crits_mongoengine.CritsBaseAttributes`
      :param left_type: The type of first top-level object.
      :type left_type: str
      :param left_id: The ObjectId of the first top-level object.
      :type left_id: str
      :param right_type: The type of second top-level object.
      :type right_type: str
      :param right_id: The ObjectId of the second top-level object.
      :type right_id: str
      :param rel_type: The type of relationship.
      :type rel_type: str
      :param rel_date: The date this relationship applies.
      :type rel_date: datetime.datetime
      :param new_type: The new type of relationship.
      :type new_type: str
      :param analyst: The user updating this relationship.
      :type analyst: str
      :returns: dict with keys "success" (boolean) and "message" (str)
docstring_summary: Update the relationship type between two top-level objects.
docstring_tokens: Update the relationship type between two top - level objects .
function: def update_relationship_types(left_class=None, right_class=None,
                                left_type=None, left_id=None,
                                right_type=None, right_id=None,
                                rel_type=None, rel_date=None,
                                new_type=None,analyst=None):
      """
      Update the relationship type between two top-level objects.
  
      :param left_class: The first top-level object.
      :type left_class: :class:`crits.core.crits_mongoengine.CritsBaseAttributes`
      :param right_class: The second top-level object.
      :type right_class: :class:`crits.core.crits_mongoengine.CritsBaseAttributes`
      :param left_type: The type of first top-level object.
      :type left_type: str
      :param left_id: The ObjectId of the first top-level object.
      :type left_id: str
      :param right_type: The type of second top-level object.
      :type right_type: str
      :param right_id: The ObjectId of the second top-level object.
      :type right_id: str
      :param rel_type: The type of relationship.
      :type rel_type: str
      :param rel_date: The date this relationship applies.
      :type rel_date: datetime.datetime
      :param new_type: The new type of relationship.
      :type new_type: str
      :param analyst: The user updating this relationship.
      :type analyst: str
      :returns: dict with keys "success" (boolean) and "message" (str)
      """
  
      if rel_date is None or rel_date == 'None':
          rel_date = None
      elif isinstance(rel_date, basestring) and rel_date != '':
          rel_date = parse(rel_date, fuzzy=True)
      elif not isinstance(rel_date, datetime.datetime):
          rel_date = None
  
      if not left_class:
          if left_type and left_id:
              left_class = class_from_id(left_type, left_id)
              if not left_class:
                  return {'success': False,
                          'message': "Unable to get object."}
          else:
              return {'success': False,
                      'message': "Need a valid left type and id"}
  
      # update relationship
      if right_class:
          results = left_class.edit_relationship_type(rel_item=right_class,
                                                      rel_type=rel_type,
                                                      rel_date=rel_date,
                                                      new_type=new_type,
                                                      analyst=analyst)
          left_class.save(username=analyst)
          right_class.save(username=analyst)
      else:
          if right_type and right_id:
              results = left_class.edit_relationship_type(type_=right_type,
                                                          rel_id=right_id,
                                                          rel_type=rel_type,
                                                          rel_date=rel_date,
                                                          new_type=new_type,
                                                          analyst=analyst)
              left_class.save(username=analyst)
          else:
              return {'success': False,
                      'message': "Need a valid right type and id"}
  
      return results
function_tokens: def update_relationship_types ( left_class = None , right_class = None , left_type = None , left_id = None , right_type = None , right_id = None , rel_type = None , rel_date = None , new_type = None , analyst = None ) : if rel_date is None or rel_date == 'None' : rel_date = None elif isinstance ( rel_date , basestring ) and rel_date != '' : rel_date = parse ( rel_date , fuzzy = True ) elif not isinstance ( rel_date , datetime . datetime ) : rel_date = None if not left_class : if left_type and left_id : left_class = class_from_id ( left_type , left_id ) if not left_class : return { 'success' : False , 'message' : "Unable to get object." } else : return { 'success' : False , 'message' : "Need a valid left type and id" } # update relationship if right_class : results = left_class . edit_relationship_type ( rel_item = right_class , rel_type = rel_type , rel_date = rel_date , new_type = new_type , analyst = analyst ) left_class . save ( username = analyst ) right_class . save ( username = analyst ) else : if right_type and right_id : results = left_class . edit_relationship_type ( type_ = right_type , rel_id = right_id , rel_type = rel_type , rel_date = rel_date , new_type = new_type , analyst = analyst ) left_class . save ( username = analyst ) else : return { 'success' : False , 'message' : "Need a valid right type and id" } return results