Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_casanatics
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
John Aidan Vincent M. Ng
midterm_casanatics
Commits
e372e982
Commit
e372e982
authored
Mar 04, 2023
by
Angelo Alvarez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added specified models to Calendar app
parent
fd90c34d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
0 deletions
+32
-0
__init__.cpython-310.pyc
...anatics/calendar_app/__pycache__/__init__.cpython-310.pyc
+0
-0
apps.cpython-310.pyc
..._casanatics/calendar_app/__pycache__/apps.cpython-310.pyc
+0
-0
models.cpython-310.pyc
...asanatics/calendar_app/__pycache__/models.cpython-310.pyc
+0
-0
models.py
widget_casanatics/calendar_app/models.py
+24
-0
views.py
widget_casanatics/dashboard/views.py
+8
-0
No files found.
widget_casanatics/calendar_app/__pycache__/__init__.cpython-310.pyc
0 → 100644
View file @
e372e982
File added
widget_casanatics/calendar_app/__pycache__/apps.cpython-310.pyc
0 → 100644
View file @
e372e982
File added
widget_casanatics/calendar_app/__pycache__/models.cpython-310.pyc
0 → 100644
View file @
e372e982
File added
widget_casanatics/calendar_app/models.py
View file @
e372e982
from
django.db
import
models
from
assignments.models
import
Course
# Create your models here.
class
Location
(
models
.
Model
):
LOCATION_CHOICES
=
[
(
'ONSITE'
,
'Onsite'
),
(
'ONLINE'
,
'Online'
),
(
'HYBRID'
,
'Hybrid'
),
]
mode
=
models
.
CharField
(
max_length
=
6
,
choices
=
LOCATION_CHOICES
,
default
=
'ONSITE'
)
venue
=
models
.
CharField
(
max_length
=
50
)
def
__str__
(
self
):
return
self
.
venue
class
Event
(
models
.
Model
):
target_datetime
=
models
.
DateTimeField
()
activity
=
models
.
CharField
(
max_length
=
50
)
estimated_hours
=
models
.
FloatField
()
location
=
models
.
ForeignKey
(
Location
,
on_delete
=
models
.
CASCADE
)
course
=
models
.
ForeignKey
(
Course
,
on_delete
=
models
.
CASCADE
)
def
__str__
(
self
):
return
self
.
activity
widget_casanatics/dashboard/views.py
View file @
e372e982
from
django.shortcuts
import
render
from
django.db
import
models
from
assignments.models
import
Course
# Create your views here.
class
Event
(
models
.
Model
):
target_datetime
=
models
.
DateTimeField
()
activity
=
models
.
CharField
(
max_length
=
50
)
estimated_hours
=
models
.
FloatField
()
location
=
models
.
CharField
(
max_length
=
50
)
course
=
models
.
ForeignKey
(
Course
,
on_delete
=
models
.
CASCADE
)
\ No newline at end of file
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