Skip to content

Commit

Permalink
Update doc for kiddouk#14
Browse files Browse the repository at this point in the history
  • Loading branch information
kiddouk committed Oct 16, 2012
1 parent d65d81d commit aa3a0d8
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------------

Expand Down

0 comments on commit aa3a0d8

Please sign in to comment.