Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
midterm_OhMyBash
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
Nheo Samson
midterm_OhMyBash
Commits
8f02ef99
Commit
8f02ef99
authored
Mar 06, 2023
by
nheoxoz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed course variable in calendar
parent
5095f46e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
models.py
widget_OhMyBash/widget_calendar/models.py
+11
-7
views.py
widget_OhMyBash/widget_calendar/views.py
+5
-1
No files found.
widget_OhMyBash/widget_calendar/models.py
View file @
8f02ef99
...
@@ -2,13 +2,13 @@ from django.db import models
...
@@ -2,13 +2,13 @@ from django.db import models
class
Location
(
models
.
Model
):
class
Location
(
models
.
Model
):
onsite
=
'
O
nsite'
onsite
=
'
o
nsite'
online
=
'
O
nline'
online
=
'
o
nline'
hybrid
=
'
H
ybrid'
hybrid
=
'
h
ybrid'
mode_choices
=
[
mode_choices
=
[
(
onsite
,
'
O
nsite'
),
(
onsite
,
'
o
nsite'
),
(
online
,
'
O
nline'
),
(
online
,
'
o
nline'
),
(
hybrid
,
'
H
ybrid'
),
(
hybrid
,
'
h
ybrid'
),
]
]
mode
=
models
.
CharField
(
mode
=
models
.
CharField
(
max_length
=
6
,
choices
=
mode_choices
,
default
=
onsite
,
max_length
=
6
,
choices
=
mode_choices
,
default
=
onsite
,
...
@@ -24,7 +24,11 @@ class Event(models.Model):
...
@@ -24,7 +24,11 @@ class Event(models.Model):
activity
=
models
.
CharField
(
max_length
=
255
)
activity
=
models
.
CharField
(
max_length
=
255
)
estimated_hours
=
models
.
FloatField
()
estimated_hours
=
models
.
FloatField
()
location
=
models
.
ForeignKey
(
Location
,
on_delete
=
models
.
CASCADE
)
location
=
models
.
ForeignKey
(
Location
,
on_delete
=
models
.
CASCADE
)
course
=
models
.
CharField
(
max_length
=
100
)
course
=
course
=
models
.
ForeignKey
(
'assignments.Course'
,
on_delete
=
models
.
CASCADE
,
related_name
=
"event_course"
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'{}, {}'
.
format
(
self
.
activity
,
self
.
target_datetime
)
return
'{}, {}'
.
format
(
self
.
activity
,
self
.
target_datetime
)
widget_OhMyBash/widget_calendar/views.py
View file @
8f02ef99
...
@@ -13,7 +13,11 @@ def index(request):
...
@@ -13,7 +13,11 @@ def index(request):
)
)
return_string
+=
'Activity: {}<br>'
.
format
(
events
.
activity
)
return_string
+=
'Activity: {}<br>'
.
format
(
events
.
activity
)
return_string
+=
'Estimated Hours: {}<br>'
.
format
(
round_hours
)
return_string
+=
'Estimated Hours: {}<br>'
.
format
(
round_hours
)
return_string
+=
'Course/Section: {}<br>'
.
format
(
events
.
course
)
return_string
+=
'Course/Section: {} {}-{}<br>'
.
format
(
events
.
course
.
code
,
events
.
course
.
title
,
events
.
course
.
section
,
)
return_string
+=
'Mode: {}<br>'
.
format
(
events
.
location
.
mode
)
return_string
+=
'Mode: {}<br>'
.
format
(
events
.
location
.
mode
)
return_string
+=
'Venue: {}<br>'
.
format
(
events
.
location
.
venue
)
return_string
+=
'Venue: {}<br>'
.
format
(
events
.
location
.
venue
)
return_string
+=
'<br>'
return_string
+=
'<br>'
...
...
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