From 3ebe90d3cef8c2136c17a1b3426e7989f2379427 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 13 Jan 2009 17:57:08 +0100 Subject: [PATCH] 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'; --- influences/models.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.30.2