18 lines
544 B
Python
18 lines
544 B
Python
from django.db import models
|
|
|
|
from .course import Course
|
|
from .vessel import Vessel
|
|
|
|
|
|
class CrewMember(models.Model):
|
|
pin = models.IntegerField(primary_key=True)
|
|
first_name = models.CharField(max_length=256)
|
|
last_name = models.CharField(max_length=256)
|
|
email = models.EmailField()
|
|
dob = models.DateField()
|
|
|
|
|
|
class CourseAssignment(models.Model):
|
|
crew = models.ForeignKey(CrewMember, models.CASCADE)
|
|
course = models.ForeignKey(Course, models.CASCADE)
|
|
vessel = models.ForeignKey(Vessel, models.CASCADE, null=True)
|