xmpp.chapril.org-conversejs/lang/models.py

14 lines
437 B
Python
Raw Normal View History

2012-02-27 10:14:00 +01:00
from django.db import models
2012-02-27 10:22:33 +01:00
class Language(models.Model):
2012-03-01 10:37:44 +01:00
code = models.SlugField(unique = True)
2012-02-27 10:22:33 +01:00
name = models.CharField(max_length = 100)
nplurals = models.SmallIntegerField(default = 0)
pluralequation = models.CharField(max_length = 255, blank = True)
2012-02-27 16:14:36 +01:00
def __unicode__(self):
return self.name
2012-02-29 13:46:25 +01:00
def get_plural_form(self):
return 'nplurals=%d; plural=%s;' % (self.nplurals, self.pluralequation)