Skip to content

Instantly share code, notes, and snippets.

@mizchi
Created August 20, 2010 20:28
Show Gist options
  • Select an option

  • Save mizchi/541093 to your computer and use it in GitHub Desktop.

Select an option

Save mizchi/541093 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# -*- encoding:utf-8 -*-
from sys import argv
import os
from lazyboy import *
from lazyboy.key import Key
class PostKey(Key):
def __init__(self, key=None):
Key.__init__(self, "Keyspace1", "Standard1", key)
class PostData(record.Record):
def setKey(self, Key):
self.key = Key
def main(argv):
connection.add_pool('Keyspace1', ['localhost:9160'])
post = PostData()
post.setKey(PostKey("key1"))
post.update({'column1':"foo", 'column2':"bar"})
post.save()
post = PostData().load(PostKey('key1'))
print post['column1']
if __name__ == '__main__':
main(argv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment