Skip to content

Instantly share code, notes, and snippets.

View djfroofy's full-sized avatar

Drew Smathers djfroofy

  • Pro Solutions Llc.
  • Seattle, WA
View GitHub Profile
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):