Adde Aircraft class and associate students with aircrafts
This commit is contained in:
@@ -2,6 +2,7 @@ from django.db import models
|
||||
from django.contrib.auth.models import User, Group
|
||||
|
||||
from ..models.courses import Course
|
||||
from ..models.aircrafts import Aircraft
|
||||
|
||||
class Student(models.Model):
|
||||
id = models.AutoField(
|
||||
@@ -46,6 +47,10 @@ class Student(models.Model):
|
||||
blank=True
|
||||
)
|
||||
|
||||
aircrafts = models.ManyToManyField(
|
||||
Aircraft
|
||||
)
|
||||
|
||||
def default_password(self) -> str: # Maximum 4 digits for passowrd
|
||||
return f"{self.name.lower()[0]}{self.surname.lower()}{self.id % 10000}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user