-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Simon Zimmermann
committed
Jan 14, 2012
1 parent
f409b75
commit 595308d
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# odis | ||
|
||
odis - objects in [Redis](http://redis.io) for Python. | ||
|
||
## Install odis | ||
|
||
$ pip install git+git://github.com/simonz05/odis.git | ||
|
||
## Use odis | ||
|
||
from odis import Model, CharField, DateTimeField | ||
|
||
class Foo(Model): | ||
username = CharField(index=True, unique=True) | ||
created_at = DateTimeField(aut_now_add=True) | ||
|
||
|
||
>>> obj = Foo(username='foo') | ||
>>> obj.save() | ||
True | ||
|
||
>>> Foo.obj.get(username='foo') | ||
<Foo {'username': 'foo', 'pk': 1, 'created_at': datetime.datetime(2012, 1, 14, 0, 0)}> | ||
|
||
>>> Foo.obj.filter(username='foo') | ||
<odis.QuerySet at 0x24e50d0> | ||
|
||
## Acknowledgment | ||
|
||
[Ohm](http://ohm.keyvalue.org/), [redisco](https://github.com/iamteem/redisco/) and | ||
[Django internals](https://github.com/django/django/tree/master/django/db/models) | ||
were used to figure out how to solve similar problems. |