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
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]