1 from django.db import models
2 from django.utils.translation import ugettext_lazy as _
4 class Section(models.Model):
5 name = models.CharField(_('name'), max_length=255)
6 slug = models.SlugField(_('slug'))
7 order = models.IntegerField(_('order'))
11 verbose_name = _('section')
12 verbose_name_plural = _('sections')
14 def __unicode__(self):
17 class Competence(models.Model):
18 section = models.ForeignKey(Section)
19 name = models.CharField(_('name'), max_length=255)
20 slug = models.SlugField(_('slug'))
21 order = models.IntegerField(_('order'))
25 verbose_name = _('competence')
26 verbose_name_plural = _('competences')
28 def __unicode__(self):
31 class Level(models.Model):
32 name = models.CharField(_('name'), max_length=255)
33 slug = models.SlugField(_('slug'))
34 order = models.IntegerField(_('order'))
38 verbose_name = _('educational level')
39 verbose_name_plural = _('educational levels')
41 def __unicode__(self):
44 class CompetenceLevel(models.Model):
45 competence = models.ForeignKey(Competence)
46 level = models.ForeignKey(Level)
47 description = models.TextField(_('description'))
50 ordering = ['competence', 'level']
51 verbose_name = _('competence on level')
52 verbose_name_plural = _('competences on levels')
54 def __unicode__(self):
55 return "%s/%s" % (self.competence, self.level)