Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CSCI 41 Project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patricia Isabella Nava
CSCI 41 Project
Commits
5d6ce8a3
Commit
5d6ce8a3
authored
Dec 04, 2022
by
Patricia Isabella Nava
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: add default values to time and date fields of models
parent
f359e477
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
models.py
MagisAir/booking/models.py
+7
-6
No files found.
MagisAir/booking/models.py
View file @
5d6ce8a3
from
django.db
import
models
from
django.http
import
Http404
from
django.core.validators
import
RegexValidator
,
EmailValidator
from
django.utils.timezone
import
now
# Create your models here.
...
...
@@ -9,7 +10,7 @@ class Passenger(models.Model):
First_Name
=
models
.
CharField
(
max_length
=
50
)
Middle_Initial
=
models
.
CharField
(
max_length
=
50
,
blank
=
True
)
Last_Name
=
models
.
CharField
(
max_length
=
50
)
Birthdate
=
models
.
DateField
(
null
=
True
,
blank
=
True
)
Birthdate
=
models
.
DateField
(
null
=
True
,
blank
=
True
,
default
=
now
)
Age
=
models
.
CharField
(
max_length
=
3
)
male
=
'Male'
female
=
'Female'
...
...
@@ -62,10 +63,10 @@ class Additional_Item(models.Model):
class
Schedule
(
models
.
Model
):
Sched_Code
=
models
.
AutoField
(
primary_key
=
True
,
editable
=
False
,
unique
=
True
)
Flight_Date
=
models
.
DateField
(
null
=
True
,
blank
=
True
)
Departure_Time
=
models
.
TimeField
(
null
=
True
,
blank
=
True
)
Arrival_Time
=
models
.
TimeField
(
null
=
True
,
blank
=
True
)
Duration
=
models
.
CharField
(
max_length
=
50
)
Flight_Date
=
models
.
DateField
(
default
=
now
,
null
=
True
,
blank
=
True
)
Departure_Time
=
models
.
TimeField
(
null
=
True
,
blank
=
True
,
default
=
"00:00:00"
)
Arrival_Time
=
models
.
TimeField
(
null
=
True
,
blank
=
True
,
default
=
'00:00:00'
)
Duration
=
models
.
CharField
(
max_length
=
50
,
default
=
'0 hr 0 min'
)
Flight_Cost
=
models
.
IntegerField
(
default
=
0
)
Flight_Code
=
models
.
ForeignKey
(
Flight
,
on_delete
=
models
.
CASCADE
)
...
...
@@ -75,7 +76,7 @@ class Schedule(models.Model):
class
Booking
(
models
.
Model
):
Booking_ID
=
models
.
AutoField
(
primary_key
=
True
,
editable
=
False
,
unique
=
True
)
Booking_Date
=
models
.
DateField
(
null
=
True
,
blank
=
True
)
Booking_Date
=
models
.
DateField
(
default
=
now
,
null
=
True
)
Total_Cost
=
models
.
IntegerField
(
blank
=
True
,
default
=
0
,
null
=
False
,
editable
=
False
)
Passenger
=
models
.
ForeignKey
(
Passenger
,
on_delete
=
models
.
CASCADE
)
Additional_Item
=
models
.
ManyToManyField
(
Additional_Item
,
through
=
'Booking_AddItem'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment