Add Character.type property.
authorMatthijs Kooijman <matthijs@stdin.nl>
Tue, 13 Jan 2009 16:57:08 +0000 (17:57 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Tue, 13 Jan 2009 17:06:56 +0000 (18:06 +0100)
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';

influences/models.py

index 796d8f43c83bb9c7342172d58ec5ae385fc6c3f5..9fd77ef846954815a32c9a2108bc23a5ee9f16cf 100644 (file)
@@ -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