Skip to content

Instantly share code, notes, and snippets.

@myusuf3
Created March 13, 2011 04:03
Show Gist options
  • Save myusuf3/867851 to your computer and use it in GitHub Desktop.
Save myusuf3/867851 to your computer and use it in GitHub Desktop.
currently what I have not completed all the way through
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