from django.db import models

class Course(models.Model):
    def __str__(self):
        return self.name
        
    name = models.CharField(max_length=25)

class Group(models.Model):
    def __str__(self):
        return self.name
        
    name = models.CharField(max_length=25)
    
class Student(models.Model):
    def __str__(self):
        return self.name
        
    PACKAGE_CHOICES = (
        ('step1', 'Step1'),
        ('step2', 'Step2'),
        ('step3', 'Step3'),
    )
    
    name = models.CharField(max_length=255)
    surname = models.CharField(max_length=255)
    date_of_birth = models.DateField()
    email = models.EmailField(blank=True)
    phone = models.CharField(max_length=15, blank=True)
    package = models.CharField(max_length=15, choices=PACKAGE_CHOICES)
    note = models.TextField(blank=True)
    group = models.ForeignKey(Group, related_name='students')
    course = models.ManyToManyField(Course, related_name='students')


