This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from djredis.models import DredisMixin | |
import djredis.fields | |
class Blog(models.Model, DredisMixin): # inherit from the mixin class | |
author = models.ForeignKey('Author') | |
title = models.CharField(max_length=200) | |
viewcount = djredis.fields.Counter() | |
# optionally add a unique keyspace for the instance - default is shown below | |
def redis_key(self): |
NewerOlder