kiddouk/redisco — pull request #29 by boostbob (2013-10-23 09:36:53+00:00)
Title: add __getitem__ to ModelBase for [] call syntax

Hi, i have add `\_\_getitem\_\_` method for ModelBase class, so i can to write `Model[id]` instead of `Model.objects.get_by_id()`, Although the modification is small, but I think it is useful. Already test passed.

Thank you for create this repo, it's really nice.

```py
from redisco import models

class Person(models.Model):
name = models.Attribute(required=True, unique=True, indexed=True)

Person(name="debugger").save()
p = Person.objects.filter(name="debugger").first()

print p.id
print Person.objects.get_by_id(p.id)
# short code for above
print Person[p.id]
```