from __future__ import unicode_literals

from django.db import models
from django.utils.translation import ugettext as _


class Group(models.Model):
    """
    Group model
    """

    title = models.CharField(max_length=256, blank=False, verbose_name=_('Name'))
    leader = models.OneToOneField(
        'Student', verbose_name=_('Leader'), blank=True, null=True, on_delete=models.SET_NULL)
    notes = models.TextField(blank=True, verbose_name=_('Additional notices'))

    class Meta(object):
        verbose_name = _('Group')
        verbose_name_plural = _('Groups')

    def __str__(self):
        if self.leader:
            return '{} ({} {})'.format(
                self.title, self.leader.first_name, self.leader.last_name)
        else:
            return '{}'.format(None)

[((18, 23, 18, 33), 'django.utils.translation.ugettext', '_', ({(18, 25, 18, 32): '"""Group"""'}, {}), "('Group')", True, 'from django.utils.translation import ugettext as _\n'), ((19, 30, 19, 41), 'django.utils.translation.ugettext', '_', ({(19, 32, 19, 40): '"""Groups"""'}, {}), "('Groups')", True, 'from django.utils.translation import ugettext as _\n'), ((12, 71, 12, 80), 'django.utils.translation.ugettext', '_', ({(12, 73, 12, 79): '"""Name"""'}, {}), "('Name')", True, 'from django.utils.translation import ugettext as _\n'), ((14, 32, 14, 43), 'django.utils.translation.ugettext', '_', ({(14, 34, 14, 42): '"""Leader"""'}, {}), "('Leader')", True, 'from django.utils.translation import ugettext as _\n'), ((15, 54, 15, 77), 'django.utils.translation.ugettext', '_', ({(15, 56, 15, 76): '"""Additional notices"""'}, {}), "('Additional notices')", True, 'from django.utils.translation import ugettext as _\n')]