* Add some fields to influence's models.
authorMatthijs Kooijman <matthijs@stdin.nl>
Wed, 23 Jan 2008 12:47:41 +0000 (13:47 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Wed, 23 Jan 2008 12:47:41 +0000 (13:47 +0100)
influences/models.py

index d5db8a39b5cfc598f65df9d1f7e939f9aa54fc38..5f118214cba7857e187eba35e6b591f0426f8a8f 100644 (file)
@@ -1,10 +1,13 @@
 from django.db import models
+from django.contrib.auth.models import User
 
 # Create your models here.
 class Character(models.Model):
        created     = models.DateField(auto_now_add=1)
        modified    = models.DateField(auto_now=1)
-       name = models.CharField(max_length=255)
+       name        = models.CharField(max_length=255)
+       player      = models.ForeignKey(User)
+
        def __str__(self):
                return self.name
 
@@ -12,11 +15,19 @@ class Character(models.Model):
                pass
 
 class Influence(models.Model):
+       STATUS_CHOICES = (
+               ('N', 'New'),
+               ('P', 'Processing'),
+               ('D', 'Done'),
+       )
        created     = models.DateField(auto_now_add=1)
        modified    = models.DateField(auto_now=1)
+       
+       character   = models.ForeignKey(Character, null=True, blank=True, edit_inline=models.TABULAR, num_in_admin=3, core=True)
        contact     = models.CharField(max_length=255)
-       character   = models.ForeignKey(Character, edit_inline=models.TABULAR, num_in_admin=3, core=True)
        description = models.TextField()
+       status      = models.TextField(max_length=1, choices=STATUS_CHOICES, default='N')
+       longterm    = models.BooleanField(default=False)
 
        def __str__(self):
                return self.description[0:10]