Skip to content

Commit

Permalink
Merge pull request #28 from bethjohnson/master
Browse files Browse the repository at this point in the history
Adds 'PICKS' relationship to database. Closes #19
  • Loading branch information
jimgong92 committed Dec 30, 2014
2 parents 9fb41e8 + 4f88688 commit 9562f9a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ def findDrivers( origin, destination ):

def findPassengers ( origin, destination ):
return findNodes("Passenger", origin, destination)

def pickDriver(passengerId, driverId):
a = graph.merge_one("Passenger","id",passengerId)
b = graph.merge_one("Driver","id",driverId)
graph.create_unique(Relationship(a,"PICKS",b))

def pickPassenger(driverId, passengerId):
a = graph.merge_one("Driver","id",driverId)
b = graph.merge_one("Passenger","id",passengerId)
graph.create_unique(Relationship(a,"PICKS",b))
# query = "MATCH (a),(b) WHERE a.id = %s AND b.id = %s CREATE (a)-[r:PICKS]->(b) RETURN r" %(userAId, userBId)
# data = graph.cypher.execute(query)
#
'''
| passengers
Expand Down

0 comments on commit 9562f9a

Please sign in to comment.