liberation/redis-limpyd — pull request #24 by yohanboniface (2012-07-01 19:57:09+00:00)
Title: Collectionmanager

Introducing the CollectionManager:

Retrieve objects collection, optionaly slice and order it.
CollectionManager is lazy: it will call redis only when evaluating it
(iterating, slicing, forcing as list...)

API:
MyModel.collection(**filters) => return the whole collection, eventually filtered.
MyModel.collection().sort(by='field') => return the collection sorted.
MyModel.collection().sort(by='field')[:10] => slice the sorted collection.
MyModel.collection().instances() => return the instances

Note:
Slicing a collection will force a sort.