Commit 4bdd0070 authored by Stephanie Tullao's avatar Stephanie Tullao

Made some modifications for models

parent dff11275
......@@ -52,8 +52,8 @@ class Booking_Sched(models.Model):
class Meta:
unique_together = ('Booking_ID', 'Sched_Code')
Booking_ID = models.ForeignKey(Booking, unique=True, on_delete=models.CASCADE)
Sched_Code = models.ForeignKey(Schedule, unique=True, on_delete=models.CASCADE)
Booking_ID = models.ForeignKey(Booking, on_delete=models.CASCADE)
Sched_Code = models.ForeignKey(Schedule, on_delete=models.CASCADE)
class Additional_Item(models.Model):
Description = models.CharField(max_length=50, primary_key=True, editable=False, unique=True)
......@@ -63,8 +63,8 @@ class Booking_AddItem(models.Model):
class Meta:
unique_together = ('Booking_ID', 'AddItem_Desc')
Booking_ID = models.ForeignKey(Booking, unique=True, on_delete=models.CASCADE)
AddItem_Desc = models.ForeignKey(Additional_Item, unique=True, on_delete=models.CASCADE)
Booking_ID = models.ForeignKey(Booking, on_delete=models.CASCADE)
AddItem_Desc = models.ForeignKey(Additional_Item, on_delete=models.CASCADE)
Quantity = models.IntegerField(default=0)
class City(models.Model):
......@@ -91,11 +91,11 @@ class Sched_Crew(models.Model):
class Meta:
unique_together = ('Sched_Code', 'Employee_ID')
Sched_Code = models.ForeignKey(Schedule, unique=True, on_delete=models.CASCADE)
Employee_ID = models.ForeignKey(Crew_Member, unique=True, on_delete=models.CASCADE)
Sched_Code = models.ForeignKey(Schedule, on_delete=models.CASCADE)
Employee_ID = models.ForeignKey(Crew_Member, on_delete=models.CASCADE)
class Pilot(models.Model):
Employee_ID = models.ForeignKey(Crew_Member, unique=True, on_delete=models.CASCADE, primary_key=True)
Employee_ID = models.OneToOneField(Crew_Member, on_delete=models.CASCADE, primary_key=True)
cadet_pilot = 'Cadet Pilot'
second_officer = 'Second Officer'
first_officer = 'First Officer'
......@@ -111,7 +111,7 @@ class Pilot(models.Model):
Rank = models.CharField(max_length=50, choices=rank_choices)
class Flight_Attendant(models.Model):
Employee_ID = models.ForeignKey(Crew_Member, unique=True, on_delete=models.CASCADE, primary_key=True)
Employee_ID = models.OneToOneField(Crew_Member, on_delete=models.CASCADE, primary_key=True)
economy = 'Economy'
premium_economy = 'Premium Economy'
business = 'Business'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment