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
b12b5ef9
Commit
b12b5ef9
authored
Mar 04, 2023
by
Angelo Alvarez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added views and urls of Calendar app
parent
e372e982
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
2 deletions
+41
-2
models.cpython-310.pyc
...asanatics/calendar_app/__pycache__/models.cpython-310.pyc
+0
-0
models.py
widget_casanatics/calendar_app/models.py
+1
-1
urls.py
widget_casanatics/calendar_app/urls.py
+9
-0
views.py
widget_casanatics/calendar_app/views.py
+29
-0
__init__.cpython-310.pyc
...cs/widget_casanatics/__pycache__/__init__.cpython-310.pyc
+0
-0
settings.cpython-310.pyc
...cs/widget_casanatics/__pycache__/settings.cpython-310.pyc
+0
-0
urls.py
widget_casanatics/widget_casanatics/urls.py
+2
-1
No files found.
widget_casanatics/calendar_app/__pycache__/models.cpython-310.pyc
View file @
b12b5ef9
No preview for this file type
widget_casanatics/calendar_app/models.py
View file @
b12b5ef9
...
@@ -16,7 +16,7 @@ class Location(models.Model):
...
@@ -16,7 +16,7 @@ class Location(models.Model):
return
self
.
venue
return
self
.
venue
class
Event
(
models
.
Model
):
class
Event
(
models
.
Model
):
target_datetime
=
models
.
DateTimeField
()
target_datetime
=
models
.
DateTimeField
(
"Target Date and Time"
,
)
activity
=
models
.
CharField
(
max_length
=
50
)
activity
=
models
.
CharField
(
max_length
=
50
)
estimated_hours
=
models
.
FloatField
()
estimated_hours
=
models
.
FloatField
()
location
=
models
.
ForeignKey
(
Location
,
on_delete
=
models
.
CASCADE
)
location
=
models
.
ForeignKey
(
Location
,
on_delete
=
models
.
CASCADE
)
...
...
widget_casanatics/calendar_app/urls.py
0 → 100644
View file @
b12b5ef9
# <appname>/urls.py
from
django.urls
import
path
from
.views
import
index
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
]
app_name
=
"calendar_app"
\ No newline at end of file
widget_casanatics/calendar_app/views.py
View file @
b12b5ef9
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
.models
import
Event
# Create your views here.
# Create your views here.
def
index
(
request
):
eventInfo
=
""
events
=
Event
.
objects
.
all
()
for
event
in
events
:
eventInfo
+=
'''
Date and Time: {} <br>
Activity: {} <br>
Estimated Hours: {} <br>
Course/Section: {} {}-{} <br>
Mode: {} <br>
Venue: {} <br>
<br>
'''
.
format
(
event
.
target_datetime
.
strftime
(
"
%
m/
%
d/
%
Y,
%
I:
%
M
%
p"
),
event
.
activity
(),
event
.
estimated_hours
(),
event
.
course
.
code
(),
event
.
course
.
title
(),
event
.
course
.
section
(),
event
.
location
.
mode
(),
event
.
location
.
venue
()
)
return
HttpResponse
(
'''
Widget's Calendar of Activities <br>
<br>
{}
'''
.
format
(
eventInfo
))
\ No newline at end of file
widget_casanatics/widget_casanatics/__pycache__/__init__.cpython-310.pyc
View file @
b12b5ef9
No preview for this file type
widget_casanatics/widget_casanatics/__pycache__/settings.cpython-310.pyc
View file @
b12b5ef9
No preview for this file type
widget_casanatics/widget_casanatics/urls.py
View file @
b12b5ef9
...
@@ -14,8 +14,9 @@ Including another URLconf
...
@@ -14,8 +14,9 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
"""
from
django.contrib
import
admin
from
django.contrib
import
admin
from
django.urls
import
path
from
django.urls
import
path
,
include
urlpatterns
=
[
urlpatterns
=
[
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'calendar/'
,
include
(
'calendar_app.urls'
,
namespace
=
"calendar_app"
))
]
]
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