Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uy_lab1
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
Amyll Angelin
uy_lab1
Commits
f98aef07
Commit
f98aef07
authored
Apr 10, 2021
by
Amyll Angelin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete Works Now
^
parent
23538543
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
5 deletions
+9
-5
urls.cpython-39.pyc
Lab1/Bujo/__pycache__/urls.cpython-39.pyc
+0
-0
views.cpython-39.pyc
Lab1/Pages/__pycache__/views.cpython-39.pyc
+0
-0
views.py
Lab1/Pages/views.py
+8
-4
delete_week.html
Lab1/Templates/delete_week.html
+1
-1
No files found.
Lab1/Bujo/__pycache__/urls.cpython-39.pyc
View file @
f98aef07
No preview for this file type
Lab1/Pages/__pycache__/views.cpython-39.pyc
View file @
f98aef07
No preview for this file type
Lab1/Pages/views.py
View file @
f98aef07
...
@@ -81,10 +81,12 @@ def edit_week_view(request, *args, **kwargs):
...
@@ -81,10 +81,12 @@ def edit_week_view(request, *args, **kwargs):
form
.
save
()
form
.
save
()
return
render
(
request
,
"edit_week.html"
,
{
"form"
:
form
})
return
render
(
request
,
"edit_week.html"
,
{
"form"
:
form
})
def
delete_week_view
(
request
,
*
args
,
**
kwargs
):
def
delete_week_view
(
request
,
pk
):
task
=
Week
.
objects
.
first
()
task
=
Week
.
objects
.
get
(
pk
=
pk
)
if
request
.
method
==
"POST"
:
if
request
.
method
==
"POST"
:
task
.
delete
()
task
.
delete
()
return
redirect
(
"/this_week"
)
return
render
(
request
,
"delete_week.html"
,
{
"task"
:
task
}
)
return
render
(
request
,
"delete_week.html"
,
{
"task"
:
task
}
)
...
@@ -108,7 +110,9 @@ def edit_today_view(request, *args, **kwargs):
...
@@ -108,7 +110,9 @@ def edit_today_view(request, *args, **kwargs):
return
render
(
request
,
"edit_today.html"
,
{
"form"
:
form
})
return
render
(
request
,
"edit_today.html"
,
{
"form"
:
form
})
def
delete_today_view
(
request
,
*
args
,
**
kwargs
):
def
delete_today_view
(
request
,
*
args
,
**
kwargs
):
task
=
Today
.
objects
.
first
()
task
=
Today
.
objects
.
get
(
pk
=
pk
)
if
request
.
method
==
"POST"
:
if
request
.
method
==
"POST"
:
task
.
delete
()
task
.
delete
()
return
render
(
request
,
"delete_week.html"
,
{
"task"
:
task
}
)
return
redirect
(
"/today"
)
\ No newline at end of file
return
render
(
request
,
"delete_today.html"
,
{
"task"
:
task
}
)
\ No newline at end of file
Lab1/Templates/delete_week.html
View file @
f98aef07
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<h1>
Delete Task
</h1>
<h1>
Delete Task
</h1>
<form
method =
"POST"
>
{% csrf_token %}
<form
method =
"POST"
>
{% csrf_token %}
Are you sure you would like to delete the {{task}}?
<br>
<br>
Are you sure you would like to delete the {{task}}?
<br>
<br>
<a
href=
"{% url 'this_week' %}"
><input
button
type=
"submit"
value=
"Yes"
></a>
</input>
</form>
<a
href=
"{% url 'this_week' %
pk=task.pk()
}"
><input
button
type=
"submit"
value=
"Yes"
></a>
</input>
</form>
<a
href=
"{% url 'this_week' %}"
><button>
No
</button></a>
<br>
<br>
<a
href=
"{% url 'this_week' %}"
><button>
No
</button></a>
<br>
<br>
<br>
<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