def addConcernToUser(current, concern): title = concern.get('title') description = concern.get('description') user = __getUserByEmail(current) newConcern, = getGraph().create({"title" : title, "description" : description}) __addConcernToIndex(title, newConcern) getGraph().create((user, "CREATES", newConcern))
def getCommunities(email): currentUser = __getUserByEmail(email) rels = list(getGraph().match(start_node=currentUser, rel_type="BELONGS_TO")) communities = [] for rel in rels: communities.append(rel.end_node.get_properties()) #print (getGraph().node(rel.end_node)) return communities
def addConcernToUser(current, concern): title = concern.get('title') description = concern.get('description') user = __getUserByEmail(current) newConcern, = getGraph().create({ "title": title, "description": description }) __addConcernToIndex(title, newConcern) getGraph().create((user, "CREATES", newConcern))
def getAllConcerns(email): print("getAllConcerns") currentUser = __getUserByEmail(email) rels = list(getGraph().match(start_node=currentUser, rel_type="CREATES")) concerns = [] for rel in rels: currentConcern = rel.end_node.get_properties() currentConcern["id"] = rel.end_node._id concerns.append(currentConcern) return concerns
def getAllConcerns(email): print ("getAllConcerns") currentUser = __getUserByEmail(email) rels = list(getGraph().match(start_node=currentUser, rel_type="CREATES")) concerns = [] for rel in rels: currentConcern = rel.end_node.get_properties() currentConcern["id"] = rel.end_node._id concerns.append(currentConcern) return concerns
def addCommunityToContact(name, email): userFound = __getUserByEmail(email) communityFound = __getCommunity(name) getGraph().create((userFound, "BELONGS_TO", communityFound))