Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_aguandhischipmunks
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
Adrian Lance Damalerio
midterm_aguandhischipmunks
Commits
ca6a7896
Commit
ca6a7896
authored
Mar 06, 2023
by
Jan Ericsson Ong Ang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated models.py to include course object
parent
4ceb9a0f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
models.py
widget_aguandhischipmunks/calendar_app/models.py
+7
-5
No files found.
widget_aguandhischipmunks/calendar_app/models.py
View file @
ca6a7896
from
django.db
import
models
from
django.db
import
models
from
assignments.models
import
Course
#Location Choices
location_choices
=
[
location_choices
=
[
(
'onsite'
,
'ONSITE'
),
(
'onsite'
,
'ONSITE'
),
(
'online'
,
'ONLINE'
),
(
'online'
,
'ONLINE'
),
(
'hybrid'
,
'HYBRID'
),
(
'hybrid'
,
'HYBRID'
),
]
]
# Location
# mode; venue;
class
Location
(
models
.
Model
):
class
Location
(
models
.
Model
):
mode
=
models
.
CharField
(
max_length
=
50
,
choices
=
location_choices
,
default
=
'onsite'
)
mode
=
models
.
CharField
(
max_length
=
50
,
choices
=
location_choices
,
default
=
'onsite'
)
venue
=
models
.
TextField
(
max_length
=
50
)
venue
=
models
.
TextField
(
max_length
=
50
)
...
@@ -16,14 +18,14 @@ class Location(models.Model):
...
@@ -16,14 +18,14 @@ class Location(models.Model):
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
venue
return
self
.
venue
# Event
# target_datetime; activity; estimated_hours; location; course
class
Event
(
models
.
Model
):
class
Event
(
models
.
Model
):
target_datetime
=
models
.
DateTimeField
(
"Date and Time: "
,
max_length
=
50
)
target_datetime
=
models
.
DateTimeField
(
"Date and Time: "
,
max_length
=
50
)
activity
=
models
.
CharField
(
"Activity: "
,
max_length
=
50
)
activity
=
models
.
CharField
(
"Activity: "
,
max_length
=
50
)
estimated_hours
=
models
.
FloatField
(
"Estimated Hours: "
,
max_length
=
50
)
estimated_hours
=
models
.
FloatField
(
"Estimated Hours: "
,
max_length
=
50
)
location
=
models
.
ForeignKey
(
Location
,
on_delete
=
models
.
CASCADE
)
location
=
models
.
ForeignKey
(
Location
,
on_delete
=
models
.
CASCADE
)
course
=
models
.
CharField
(
"Course/Section: "
,
max_length
=
69
,
default
=
""
)
#temporary: wait for the course from assignments app
course
=
models
.
ForeignKey
(
Course
,
on_delete
=
models
.
CASCADE
)
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
activity
return
self
.
activity
...
...
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