from django.db import models
from django.contrib.auth.models import User
+from django.utils.translation import ugettext_lazy as _
# 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)
- player = models.ForeignKey(User)
+ 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"))
+ player = models.ForeignKey(User, verbose_name = _("Player"))
def __str__(self):
return self.name
class Admin:
pass
+ class Meta:
+ verbose_name = _("Character")
+ verbose_name_plural = _("Characters")
+
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)
+ created = models.DateField(auto_now_add=1, verbose_name = _("Creation time"))
+ modified = models.DateField(auto_now=1, verbose_name = _("Modification time"))
- 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)
+ character = models.ForeignKey(Character, edit_inline=models.TABULAR, num_in_admin=3, core=True, verbose_name = _("Character"))
+ contact = models.CharField(max_length=255, verbose_name = _("Contact"))
+ description = models.TextField(verbose_name = _("Description"))
+ status = models.TextField(max_length=1, choices=STATUS_CHOICES, default='N', verbose_name = _("Status"))
+ longterm = models.BooleanField(default=False, verbose_name = _("Long term"))
def __str__(self):
return self.description[0:10]
class Admin:
pass
+
+ class Meta:
+ verbose_name = _("Influence")
+ verbose_name_plural = _("Influences")
+