Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_nicsbabes
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
Nics De Vega
midterm_nicsbabes
Commits
75b62bae
Commit
75b62bae
authored
Mar 06, 2023
by
Gabriel Geraldo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edited the views for app widget_calendar
parent
eff51892
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
12 deletions
+34
-12
views.py
widget_nicsbabes/widget_calendar/views.py
+34
-12
No files found.
widget_nicsbabes/widget_calendar/views.py
View file @
75b62bae
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
.models
import
Event
,
Location
def
index
(
HttpRequest
):
def
index
(
HttpRequest
):
return
HttpResponse
(
'''
html_output
=
'''
<html>
<html>
<head>
<head>
<title>Calendar</title>
<title>Calendar</title>
</head>
</head>
<body>
<body>
<h1>Widget's Calendar of Activities</h1>
<h1>Widget's Calendar of Activities</h1>
<p>to be created</p>
'''
</body>
for
event
in
Event
.
objects
.
all
():
</html>
html_output
+=
'''
'''
)
<p>
\ No newline at end of file
Date and Time: {}<br>
Activity: {}<br>
Estimated Hours: {}<br>
Course/Section: {} {}-{}<br>
Mode: {}<br>
Venue: {}<br>
</p>
'''
.
format
(
event
.
target_datetime
.
strftime
(
"
%
m/
%
d/
%
Y,
%
I:
%
M
%
p"
),
event
.
activity
,
event
.
estimated_hours
,
event
.
course
,
event
.
course
.
title
,
event
.
course
.
section
,
event
.
location
.
mode
,
event
.
location
.
venue
)
html_output
+=
'''
</body>
</html>
'''
return
HttpResponse
(
html_output
)
\ 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