Skip to content

Instantly share code, notes, and snippets.

@vivekn
Created July 4, 2011 07:54
Show Gist options
  • Save vivekn/1063026 to your computer and use it in GitHub Desktop.
Save vivekn/1063026 to your computer and use it in GitHub Desktop.
Rorm example
from rorm import *
class User(Model):
info = Field('hash')
followers = Field('set')
following = Field('set')
"""
>>> vivek = User.create() #Auto increment ids
>>> vivek.info['field'] = 'value' #Updates database
>>> the_joker = User.create()
>>> vivek.following.add(the_joker.id)
>>> vivek.any_random_value = 2121212 # If no "Field" is specified, a normal redis key is used
>>> vivek.any_random_value
2121212
>>> ...
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment