Last active
December 30, 2015 19:38
-
-
Save j2labs/7875008 to your computer and use it in GitHub Desktop.
Thinking out loud on what Tobin might be like.
This file contains 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 tobin.querysets import RedisQuerySet | |
from schematics.models import Model | |
from schematics.types import StringType, IntType | |
class SomeModel(Model): | |
s = StringType() | |
i = IntType() | |
rds = RedisQuerySet("username", "password") | |
sm = SomeModel() | |
sm.s = 'foo' | |
sm.i = 5 | |
sm = rds.create(SomeModel, sm) | |
# OR | |
sm_data = {'s': 'foo', 'i': 5} | |
sm_data = rds.create(SomeModel, sm_data) | |
# OR | |
sm_datas = [{'s': 'foo', 'i': 5}, {'s': 'bar', 'i': 6}, {'s': 'baz', 'i': 7}] | |
sm_datas = rds.create(SomeModel, sm_datas) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment