Created
March 13, 2011 04:00
-
-
Save mgrouchy/867850 to your computer and use it in GitHub Desktop.
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 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