Permalink
Browse files

Update doc for #14

  • Loading branch information...
1 parent d65d81d commit aa3a0d824dd6261df546dfc211569eaf9890d306 @kiddouk committed Oct 16, 2012
Showing with 26 additions and 0 deletions.
  1. +26 −0 README.rst
View
@@ -140,6 +140,32 @@ auto_now
is saved. Default is False.
+Class options
+-------------
+
+You can specify some options in your Model to control the behaviour of the
+back scene.
+
+::
+ class User(models.Model):
+ firstname = models.Attribute()
+ lastname = models.Attribute()
+
+ @property
+ def fullname(self):
+ return "%s %s" % (self.firstname, self.lastname)
+
+ class Meta:
+ indices = ['fullname']
+ db = redis.Redis(host="localhost", db="6666")
+ key = 'Account'
+
+
+``indices`` is used to add extra indices that will be saved in the model.
+``db`` object will be used instead of the global redisco ``redis_client``
+``key`` will be used as the main key in the redis Hash (and sub objects)
+instead of the class name.
+
Saving and Validating
---------------------

0 comments on commit aa3a0d8

Please sign in to comment.