https://github.com/lispython/oredis
Object-hash mapping library for Redis
https://github.com/lispython/oredis
Last synced: about 1 month ago
JSON representation
Object-hash mapping library for Redis
- Host: GitHub
- URL: https://github.com/lispython/oredis
- Owner: Lispython
- License: other
- Created: 2010-11-26T09:09:13.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-11-23T08:53:44.000Z (over 12 years ago)
- Last Synced: 2025-04-15T15:11:51.482Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 113 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Object-hash mapping library for Redis.
======================================.. image:: https://secure.travis-ci.org/Lispython/oredis.png
:target: https://secure.travis-ci.org/Lispython/oredisOredis is a library for storing objects in Redis, a persistent key-value database. It includes an extensible list of validations and has very good performance.
How to use
----------.. code-block:: python
from oredis.models import Model
from oredis.manager import Manager
from oredis.fields import String, PrimaryKey, StringPK, Integer, DateTimeclass NoteManager(Manager):
passclass NoteModel(Model):
id = PrimaryKey()
title = String()
pk_hash = StringPK()
body = String(required = True)objects = NoteManager(connection = redis.Redis())
In [19]: note1 = NoteModel(title = "Hello world!",
....: body="I am currently engaged in teaching my brother to program.
He is a total beginner, but very smart. (And he actually wants to learn).
I've noticed that some of our sessions have gotten bogged down in minor details,
and I don't feel I've been very organized. (But the answers to this
post have helped a lot.)")In [20]: note1
Out[20]:In [21]: note1.title
Out[21]: 'Hello world!'In [22]: note1.title
INSTALLATION
------------To use oredis use pip or easy_install:
`pip install oredis`
or
`easy_install oredis`
CONTRIBUTE
----------Fork https://github.com/lispython/oredis/ , create commit and pull request.
Credits
-------Thanks Alexander Solovyov for some concepts are taken from orem library.