Commit 09586438 authored by Alia Lawraine Olay's avatar Alia Lawraine Olay

Added list display for admin

parent ce5cef7c
......@@ -4,16 +4,65 @@ from .models import Passenger, Booking, Schedule, Sched_Crew, City, Crew_Member,
# Register your models here.
admin.site.register(Passenger)
admin.site.register(Booking)
admin.site.register(Sched_Crew)
admin.site.register(Schedule)
admin.site.register(City)
admin.site.register(Crew_Member)
admin.site.register(Additional_Item)
admin.site.register(Flight)
admin.site.register(Booking_Sched)
admin.site.register(Booking_AddItem)
admin.site.register(Pilot)
admin.site.register(Flight_Attendant)
class PassengerAdmin(admin.ModelAdmin):
model = Passenger
list_display = ('P_ID', 'First_Name', 'Middle_Initial', 'Last_Name', 'Birthdate', 'Age', 'Gender', 'Phone_num', 'Email_add')
class BookingAdmin(admin.ModelAdmin):
model = Booking
list_display = ('Booking_ID', 'Booking_Date', 'Total_Cost', 'Passenger')
class Sched_CrewAdmin(admin.ModelAdmin):
model = Sched_Crew
list_display = ('Sched_Code', 'Employee_ID')
class ScheduleAdmin(admin.ModelAdmin):
model = Schedule
list_display = ('Sched_Code', 'Flight_Date', 'Departure_Time', 'Arrival_Time', 'Duration', 'Flight_Cost', 'Flight_Code')
class CityAdmin(admin.ModelAdmin):
model = City
list_display = ('Airport_Code', 'Airport_name', 'City_Name', 'Country')
class Crew_MemberAdmin(admin.ModelAdmin):
model = Crew_Member
list_display = ('Employee_ID', 'First_Name', 'Last_Name', 'Role')
class Additional_ItemAdmin(admin.ModelAdmin):
model = Additional_Item
list_display = ('Description', 'Item_Cost')
class FlightAdmin(admin.ModelAdmin):
model = Flight
list_display = ('Flight_ID', 'Flight_Code', 'Origin_Airport', 'Destination_Airport')
class Booking_SchedAdmin(admin.ModelAdmin):
model = Booking_Sched
list_display = ('Booking_ID', 'Sched_Code')
class Booking_AddItemAdmin(admin.ModelAdmin):
model = Booking_AddItem
list_display = ('Booking_ID', 'AddItem_Desc', 'Quantity')
class PilotAdmin(admin.ModelAdmin):
model = Pilot
list_display = ('Employee_ID', 'Rank')
class Flight_AttendantAdmin(admin.ModelAdmin):
model = Flight_Attendant
list_display = ('Employee_ID', 'Assigned_Class')
admin.site.register(Passenger, PassengerAdmin)
admin.site.register(Booking, BookingAdmin)
admin.site.register(Sched_Crew, Sched_CrewAdmin)
admin.site.register(Schedule, ScheduleAdmin)
admin.site.register(City, CityAdmin)
admin.site.register(Crew_Member, Crew_MemberAdmin)
admin.site.register(Additional_Item, Additional_ItemAdmin)
admin.site.register(Flight, FlightAdmin)
admin.site.register(Booking_Sched, Booking_SchedAdmin)
admin.site.register(Booking_AddItem, Booking_AddItemAdmin)
admin.site.register(Pilot, PilotAdmin)
admin.site.register(Flight_Attendant, Flight_AttendantAdmin)
# Generated by Django 4.0.4 on 2022-11-30 10:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('booking', '0006_auto_20221130_0902'),
]
operations = [
migrations.AlterField(
model_name='additional_item',
name='Description',
field=models.CharField(max_length=50, primary_key=True, serialize=False, unique=True),
),
]
# Generated by Django 4.0.4 on 2022-11-30 11:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('booking', '0007_alter_additional_item_description'),
]
operations = [
migrations.AddField(
model_name='booking',
name='Booking_Date',
field=models.DateField(default=0),
preserve_default=False,
),
migrations.AddField(
model_name='passenger',
name='Birthdate',
field=models.DateField(default=0),
preserve_default=False,
),
migrations.AddField(
model_name='schedule',
name='Arrival_Time',
field=models.TimeField(default=0),
preserve_default=False,
),
migrations.AddField(
model_name='schedule',
name='Departure_Time',
field=models.TimeField(default=0),
preserve_default=False,
),
migrations.AddField(
model_name='schedule',
name='Flight_Date',
field=models.DateField(default=0),
preserve_default=False,
),
]
# Generated by Django 4.0.4 on 2022-11-30 11:16
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('booking', '0008_booking_booking_date_passenger_birthdate_and_more'),
]
operations = [
migrations.RemoveField(
model_name='booking',
name='Booking_Date',
),
migrations.RemoveField(
model_name='schedule',
name='Arrival_Time',
),
migrations.RemoveField(
model_name='schedule',
name='Departure_Time',
),
migrations.RemoveField(
model_name='schedule',
name='Flight_Date',
),
]
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