python的redis中的对象
odis的Python项目详细描述
#ODIS
odis-python的[redis](http://redis.io)中的对象。
##安装ODIS
$ pip install git+git://github.com/simonz05/odis.git
##使用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>
##确认
[Ohm](http://ohm.keyvalue.org/)、[redisco](https://github.com/iamteem/redisco/)和 [Django内部](https://github.com/django/django/tree/master/django/db/models) 用来解决类似的问题。