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)

[((522, 532), 'django.utils.translation.ugettext', '_', (['"""Group"""'], {}), "('Group')\n", (523, 532), True, 'from django.utils.translation import ugettext as _\n'), ((563, 574), 'django.utils.translation.ugettext', '_', (['"""Groups"""'], {}), "('Groups')\n", (564, 574), True, 'from django.utils.translation import ugettext as _\n'), ((254, 263), 'django.utils.translation.ugettext', '_', (['"""Name"""'], {}), "('Name')\n", (255, 263), True, 'from django.utils.translation import ugettext as _\n'), ((332, 343), 'django.utils.translation.ugettext', '_', (['"""Leader"""'], {}), "('Leader')\n", (333, 343), True, 'from django.utils.translation import ugettext as _\n'), ((449, 472), 'django.utils.translation.ugettext', '_', (['"""Additional notices"""'], {}), "('Additional notices')\n", (450, 472), True, 'from django.utils.translation import ugettext as _\n')]