From: Matthijs Kooijman Date: Wed, 23 Jan 2008 12:47:41 +0000 (+0100) Subject: * Add some fields to influence's models. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=5e556c6a5f3548b843e82e74a2ae1e61384a7aed;p=matthijs%2Fprojects%2Fxerxes.git * Add some fields to influence's models. --- diff --git a/influences/models.py b/influences/models.py index d5db8a3..5f11821 100644 --- a/influences/models.py +++ b/influences/models.py @@ -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]