From 9a6de634c384f0cd553b8e8404d5c1b192d59821 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 23 Jan 2008 21:30:54 +0100 Subject: [PATCH] * Mark all model names and field names in influences as translatable strings. --- influences/models.py | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/influences/models.py b/influences/models.py index ed28de0..7c923cc 100644 --- a/influences/models.py +++ b/influences/models.py @@ -1,12 +1,13 @@ 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 @@ -14,23 +15,32 @@ class Character(models.Model): 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") + -- 2.30.2