From: Matthijs Kooijman Date: Tue, 13 Jan 2009 16:57:08 +0000 (+0100) Subject: Add Character.type property. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=3ebe90d3cef8c2136c17a1b3426e7989f2379427;p=matthijs%2Fprojects%2Fxerxes.git Add Character.type property. Also set the type of exising Characters to Player. SQL: ALTER TABLE `influences_character` ADD `type` VARCHAR( 2 ) NOT NULL AFTER `player_id`; SQL: UPDATE `influences_character` SET `type` = 'P'; --- diff --git a/influences/models.py b/influences/models.py index 796d8f4..9fd77ef 100644 --- a/influences/models.py +++ b/influences/models.py @@ -12,11 +12,17 @@ class Character(models.Model): ('N', _('New')), ('A', _('Approved')), ) + TYPE_CHOICES = ( + ('P', _('Player')), + ('N', _('NPC')), + ('C', _('Contact')), + ) created = models.DateField(auto_now_add=1, verbose_name = _("Creation time")) modified = models.DateField(auto_now=1, verbose_name = _("Modification time")) name = models.CharField(max_length=255, verbose_name = _("Name")) status = models.CharField(max_length=2, choices=STATUS_CHOICES, default='N', verbose_name = _("Status")) player = models.ForeignKey(User, verbose_name = _("Player")) + type = models.CharField(max_length=2, choices=TYPE_CHOICES, verbose_name=_("Type")) def __unicode__(self): return self.name