Skip to content

Instantly share code, notes, and snippets.

@mgrouchy
Created March 13, 2011 04:00
Show Gist options
  • Save mgrouchy/867850 to your computer and use it in GitHub Desktop.
Save mgrouchy/867850 to your computer and use it in GitHub Desktop.
from django.models import Model
from django.auth.models import User
class Achievement(Model):
user = models.foreignKey(User)
created_at = models.DateTimeField()
def fetch_achievement(self):
#do some achievement logic in here
pass
@classmethod
def get_user_achievements(cls, user):
#some functionality to fetch achievements for a current user
class SomeAchievement(Achievement):
achieved = models.BooleanField()
#achievement specific fields here
description = "this is the description of the achievement"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment