Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_aguandhischipmunks
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
Adrian Lance Damalerio
midterm_aguandhischipmunks
Commits
6b1f7ad6
Commit
6b1f7ad6
authored
May 13, 2023
by
Deokhyun Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now, edit view properly gets existing data and properly updates accordingly
parent
9dc25d9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
urls.py
widget_aguandhischipmunks/assignments/urls.py
+2
-1
views.py
widget_aguandhischipmunks/assignments/views.py
+4
-4
No files found.
widget_aguandhischipmunks/assignments/urls.py
View file @
6b1f7ad6
...
@@ -4,6 +4,7 @@ from . import views
...
@@ -4,6 +4,7 @@ from . import views
# url for assignments
# url for assignments
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
views
.
assignments_view
,
name
=
'assignment'
),
path
(
''
,
views
.
assignments_view
,
name
=
'assignment'
),
path
(
'add'
,
views
.
AssignmentAddListView
.
as_view
(),
name
=
"assignment_add"
),
path
(
'<int:pk>/details'
,
views
.
AssignmentDetailView
.
as_view
(),
name
=
'assignment_details'
),
path
(
'<int:pk>/details'
,
views
.
AssignmentDetailView
.
as_view
(),
name
=
'assignment_details'
),
path
(
'add'
,
views
.
AssignmentAddListView
.
as_view
(),
name
=
"assignment_add"
),
path
(
'<int:pk>/edit'
,
views
.
AssignmentEditView
.
as_view
(),
name
=
'assignment_edit'
),
]
]
\ No newline at end of file
widget_aguandhischipmunks/assignments/views.py
View file @
6b1f7ad6
...
@@ -29,11 +29,11 @@ class AssignmentAddListView(CreateView):
...
@@ -29,11 +29,11 @@ class AssignmentAddListView(CreateView):
# pass the pk and redirect.
# pass the pk and redirect.
return
redirect
(
'assignment_details'
,
pk
=
new_assignment
.
pk
)
return
redirect
(
'assignment_details'
,
pk
=
new_assignment
.
pk
)
else
:
else
:
return
render
(
request
,
'
book
_details.html'
,
{
'form'
:
form
})
return
render
(
request
,
'
assignment
_details.html'
,
{
'form'
:
form
})
# assignment for edditing CBV implementation.
# assignment for edditing CBV implementation.
class
Book
EditView
(
UpdateView
):
class
Assignment
EditView
(
UpdateView
):
model
=
Assignment
()
model
=
Assignment
form_class
=
AddAssignmentForm
form_class
=
AddAssignmentForm
template_name
=
'assignment-edit.html'
template_name
=
'assignment-edit.html'
...
@@ -45,4 +45,4 @@ class BookEditView(UpdateView):
...
@@ -45,4 +45,4 @@ class BookEditView(UpdateView):
# pass the pk and redirect.
# pass the pk and redirect.
return
redirect
(
'assignment_details'
,
pk
=
update_assignment
.
pk
)
return
redirect
(
'assignment_details'
,
pk
=
update_assignment
.
pk
)
else
:
else
:
return
render
(
request
,
'book_details.html'
,
{
'form'
:
form
})
return
render
(
request
,
'assignment_details.html'
,
{
'form'
:
form
})
\ No newline at end of file
\ 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