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
364eae17
Commit
364eae17
authored
May 13, 2023
by
Jose Gabriel L. Salas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed formatting errors in views and urls.py
parent
32bda5ca
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
urls.py
widget_OhMyBash/widget_calendar/urls.py
+3
-3
views.py
widget_OhMyBash/widget_calendar/views.py
+5
-5
No files found.
widget_OhMyBash/widget_calendar/urls.py
View file @
364eae17
...
...
@@ -3,9 +3,9 @@ from .views import (calendar, EventDetailView, EventCreateView, EventUpdateView)
urlpatterns
=
[
path
(
'calendar/'
,
calendar
,
name
=
'calendar'
),
path
(
'calendar/events/<int:pk>/details/'
,
EventDetailView
,
name
=
'event-details'
),
path
(
'calendar/events/add/'
,
EventCreateView
,
name
=
'event-add'
),
path
(
'calendar/events/<int:pk>/edit/'
,
EventUpdateView
,
name
=
'event-edit'
),
path
(
'calendar/events/<int:pk>/details/'
,
EventDetailView
.
as_view
()
,
name
=
'event-details'
),
path
(
'calendar/events/add/'
,
EventCreateView
.
as_view
()
,
name
=
'event-add'
),
path
(
'calendar/events/<int:pk>/edit/'
,
EventUpdateView
.
as_view
()
,
name
=
'event-edit'
),
]
# This might be needed, depending on your Django version
...
...
widget_OhMyBash/widget_calendar/views.py
View file @
364eae17
...
...
@@ -7,20 +7,20 @@ from django.views.generic.edit import CreateView, UpdateView
def
index
(
request
):
def
calendar
(
request
):
activities
=
Event
.
objects
.
all
()
return
render
(
request
,
'calendar/calendar.html'
,
{
'activities'
:
activities
})
return
render
(
request
,
'
widget_
calendar/calendar.html'
,
{
'activities'
:
activities
})
class
EventDetailView
(
DetailView
):
model
=
Event
template_name
=
"calendar/event-details.html"
template_name
=
"
widget_
calendar/event-details.html"
class
EventCreateView
(
CreateView
):
model
=
Event
fields
=
'__all__'
template_name
=
"calendar/event-add.html"
template_name
=
"
widget_
calendar/event-add.html"
class
EventUpdateView
(
UpdateView
):
model
=
Event
fields
=
'__all__'
template_name
=
'calendar/event-edit.html'
\ No newline at end of file
template_name
=
'widget_calendar/event-edit.html'
\ 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