Created
March 13, 2011 04:03
-
-
Save myusuf3/867851 to your computer and use it in GitHub Desktop.
currently what I have not completed all the way through
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.db import models | |
from django.contrib.auth.models import User | |
class ProloggerUserManager(models.Manager): | |
def create_user(self, user): | |
pro = ProloggerUser(user = user) | |
pro.save() | |
class AchievementsManager(models.Manager): | |
pass | |
class Achievements(models.Model): | |
name = models.CharField(max_length = 40) | |
points = models.IntegerField(blank=True, null = True) | |
date = models.DateField(auto_now_add=True) | |
description = models.CharField(max_length = 140) | |
objects = AchievementsManager() | |
def __unicode__(self): | |
return self.name | |
class ProloggerUser(models.Model): | |
user = models.ForeignKey(User, unique=True) | |
achievements = models.ManyToManyField(Achievements, blank=True) | |
objects = ProloggerUserManager() | |
def __unicode__(self): | |
return u"Prologger information for %s" % self.user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment