* In the add influence view, preselect the first character if it is the user's only...
[matthijs/projects/xerxes.git] / influences / models.py
index d5db8a39b5cfc598f65df9d1f7e939f9aa54fc38..ed28de0c0b86ecb09dc4bf55c63e6765001e6b18 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)
-       contact     = models.CharField(max_length=255)
+       
        character   = models.ForeignKey(Character, edit_inline=models.TABULAR, num_in_admin=3, core=True)
+       contact     = models.CharField(max_length=255)
        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]