Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_gitgud
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
Neal Luigi D. Rodriguez
midterm_gitgud
Commits
ca7266b8
Commit
ca7266b8
authored
May 12, 2023
by
Neal Luigi D. Rodriguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edit Assignment Page has been created
parent
485821f3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
16 deletions
+18
-16
urls.cpython-311.pyc
widget_gitgud/Assignments/__pycache__/urls.cpython-311.pyc
+0
-0
views.cpython-311.pyc
widget_gitgud/Assignments/__pycache__/views.cpython-311.pyc
+0
-0
assignment-edit.html
...ud/Assignments/templates/Assignments/assignment-edit.html
+11
-0
urls.py
widget_gitgud/Assignments/urls.py
+3
-1
views.py
widget_gitgud/Assignments/views.py
+4
-15
db.sqlite3
widget_gitgud/db.sqlite3
+0
-0
No files found.
widget_gitgud/Assignments/__pycache__/urls.cpython-311.pyc
View file @
ca7266b8
No preview for this file type
widget_gitgud/Assignments/__pycache__/views.cpython-311.pyc
View file @
ca7266b8
No preview for this file type
widget_gitgud/Assignments/templates/Assignments/assignment-edit.html
0 → 100644
View file @
ca7266b8
{% extends 'base.html' %}
{% load static %}
{% block title %} Edit Assignment {% endblock %}
{% block content %}
<h1>
Edit Assignment
</h1>
<form
action=
""
method=
"post"
>
{% csrf_token %}
{{ form }}
<input
type=
"submit"
value=
"Save Changes to Assignment"
>
</form>
{% endblock %}
\ No newline at end of file
widget_gitgud/Assignments/urls.py
View file @
ca7266b8
from
django.urls
import
path
from
.views
import
(
AssignmentView
,
AssignmentsDetailView
,
AssignmentsCreateView
)
AssignmentsDetailView
,
AssignmentsCreateView
,
AssignmentsUpdateView
)
urlpatterns
=
[
path
(
'assignments/'
,
AssignmentView
,
name
=
"index"
),
path
(
'<pk>/details/'
,
AssignmentsDetailView
.
as_view
(),
name
=
'assignment-details'
),
path
(
'add/'
,
AssignmentsCreateView
.
as_view
(),
name
=
'assignment-add'
),
path
(
'<pk>/edit/'
,
AssignmentsUpdateView
.
as_view
(),
name
=
'assignment-edit'
)
]
app_name
=
"Assignments"
\ No newline at end of file
widget_gitgud/Assignments/views.py
View file @
ca7266b8
...
...
@@ -19,18 +19,7 @@ class AssignmentsCreateView(CreateView):
fields
=
'__all__'
template_name
=
'Assignments/assignment-add.html'
'''
def index(request):
head_string = "<h1>Widget's Assignment Page</h1>"
body_string = ""
for assignment in Assignment.objects.all():
body_string += '<p>Assignment Name: {}</br>'.format(assignment.name)
body_string += 'Description: {}</br>'.format(assignment.description)
body_string += 'Perfect Score: {}</br>'.format(assignment.perfect_score)
body_string += 'Passing Score: {}</br>'.format(assignment.passing_score)
body_string += 'Course/Section: {} {}-{}</br>'.format(assignment.course.code, assignment.course.title, assignment.course.section)
body_string += "</p>"
html_string = '<html><head>{}</head><body>{}</body></html>'.format(head_string, body_string)
return HttpResponse(html_string)
'''
\ No newline at end of file
class
AssignmentsUpdateView
(
UpdateView
):
model
=
Assignment
fields
=
'__all__'
template_name
=
'Assignments/assignment-edit.html'
\ No newline at end of file
widget_gitgud/db.sqlite3
View file @
ca7266b8
No preview for this file type
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