Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

player model

By: a guest on Jul 30th, 2012  |  syntax: Python  |  size: 0.82 KB  |  views: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. class Player(models.Model):
  2.     def __init__(self, *args, **kwargs):
  3.           super(Player, self).__init__(*args, **kwargs)
  4.           self.secret_key = ""
  5.           self.curr_points = 0
  6.           self.curr_corr_answer = None
  7.           self.curr_q_corr_answer = None
  8.           self.curr_q_points = 0
  9.           self.curr_exp_points = 0
  10.           self.is_out = False
  11.           self.player_number = 0
  12.    
  13.     base_user = models.ForeignKey(User)
  14.     game = models.ForeignKey('Game', null=True)
  15.     gamePoints = models.IntegerField(default=0, null=True)
  16.     session = models.CharField(max_length=255)
  17.     session_id = models.CharField(max_length=255)
  18.    
  19.     def __unicode__(self):
  20.         return self.base_user.username + " | " + self.game.category.categoryName + " | " + self.game.gameType + " | " + str(self.game.started)