def create_comment(commenter_id, object_id, message): """ Create a Comment and return it. Required: id commenter_id the Person who posted the comment id object_id the object that the comment was posted to str message the body of the Comment Return: Comment??? """ prototype_edges = editor.prototype_edge_and_complement( API_EDGE_TYPE.COMMENTED_ON, {API_EDGE_PROPERTY.MESSAGE: message}, commenter_id, object_id) return editor.create_edges(prototype_edges)
def create_created(creator_id, object_id, message): """ Create a Created Edge and return it. Required: id creator_id the creator of that object id object_id the object that was created str message the message the creator attached Return: Created??? """ prototype_edges = editor.prototype_edge_and_complement( API_EDGE_TYPE.CREATED, {API_EDGE_PROPERTY.MESSAGE: message}, creator_id, object_id) return editor.create_edges(prototype_edges)
def join_league(person_id, league_id, tagger_id=None): """ Add a Person to a League. Required: id person_id ID of Person to add to League id league_id ID of League the Person is joining Optional: id tagger_id ID of Person who tagged/added/invited the joiner Return: bool success """ # TODO: for now, tagger_id is unused. fix this when we implement # tagging and/or invites. also, figure out whether we will need to # track the tagging/inviting User in addition to Person. for now, the # only call to this method is from create_player(), but there we don't # actually have access to the tagging/inviting Player. fix that too. return editor.create_edges(editor.prototype_edge_and_complement( API_EDGE_TYPE.IN_LEAGUE, {}, person_id, league_id))