Created
June 9, 2016 17:06
-
-
Save davebshow/f917f2c504c105dc967537d6a4ffd781 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tornado import gen | |
from tornado.ioloop import IOLoop | |
from goblin import properties, connection | |
from goblin.models import Vertex, Edge, V | |
class Device(Vertex): | |
serialNumber = properties.String() | |
latitude = properties.Double() | |
longitude = properties.Double() | |
deviceMetadataTable = properties.String() | |
@gen.coroutine | |
def go(): | |
# import ipdb; ipdb.set_trace() | |
device1 = yield Device.create( | |
serialNumber="abcd1234", | |
latitude=123.0, | |
longitude=55.0, | |
deviceMetadataTable="Sample String") | |
device1 = yield device1.get(device1.id) | |
device1 = yield device1.update(latitude=1234.0) | |
connection.setup("ws://localhost:8182") | |
loop = IOLoop.current() | |
try: | |
devices = loop.run_sync(go) | |
finally: | |
connection.tear_down() | |
loop.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment