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
485821f3
Commit
485821f3
authored
May 12, 2023
by
Neal Luigi D. Rodriguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a New Assignment page has been created
parent
6c533cdf
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
4 deletions
+36
-4
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
forms.py
widget_gitgud/Assignments/forms.py
+14
-0
assignment-add.html
...gud/Assignments/templates/Assignments/assignment-add.html
+11
-0
assignments.html
...gitgud/Assignments/templates/Assignments/assignments.html
+1
-1
urls.py
widget_gitgud/Assignments/urls.py
+4
-3
views.py
widget_gitgud/Assignments/views.py
+6
-0
No files found.
widget_gitgud/Assignments/__pycache__/urls.cpython-311.pyc
View file @
485821f3
No preview for this file type
widget_gitgud/Assignments/__pycache__/views.cpython-311.pyc
View file @
485821f3
No preview for this file type
widget_gitgud/Assignments/forms.py
0 → 100644
View file @
485821f3
from
django
import
forms
from
.models
import
Course
,
Assignment
class
CourseForm
(
forms
.
ModelForm
):
class
meta
:
model
=
Course
fields
=
[
'code'
,
'title'
,
'section'
]
class
AssignmentForm
(
forms
.
ModelForm
):
class
meta
:
model
=
Assignment
fields
=
[
'name'
,
'description'
,
'course'
,
'perfect_score'
]
\ No newline at end of file
widget_gitgud/Assignments/templates/Assignments/assignment-add.html
0 → 100644
View file @
485821f3
{% extends 'base.html' %}
{% load static %}
{% block title %} Add Assignment {% endblock %}
{% block content %}
<h1>
Add a New Assignment
</h1>
<form
action=
""
method=
"post"
>
{% csrf_token %}
{{ form }}
<input
type=
"submit"
value=
"Save New Assignment"
>
</form>
{% endblock %}
\ No newline at end of file
widget_gitgud/Assignments/templates/Assignments/assignments.html
View file @
485821f3
...
...
@@ -11,7 +11,7 @@
</li>
{% endfor %}
</ul>
<button>
<button
onclick=
"window.location.href='../../Assignments/add/';"
>
New Assignment
</button>
{% endblock %}
\ No newline at end of file
widget_gitgud/Assignments/urls.py
View file @
485821f3
from
django.urls
import
path
from
.views
import
(
AssignmentView
,
AssignmentsDetailView
)
AssignmentsDetailView
,
AssignmentsCreateView
)
urlpatterns
=
[
path
(
'assignment/'
,
AssignmentView
,
name
=
"index"
),
path
(
'<pk>/details/'
,
AssignmentsDetailView
.
as_view
(),
name
=
'assignment-details'
)
path
(
'assignments/'
,
AssignmentView
,
name
=
"index"
),
path
(
'<pk>/details/'
,
AssignmentsDetailView
.
as_view
(),
name
=
'assignment-details'
),
path
(
'add/'
,
AssignmentsCreateView
.
as_view
(),
name
=
'assignment-add'
),
]
app_name
=
"Assignments"
\ No newline at end of file
widget_gitgud/Assignments/views.py
View file @
485821f3
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
.models
import
Assignment
,
Course
# Create your views here.
...
...
@@ -13,6 +14,11 @@ class AssignmentsDetailView(DetailView):
model
=
Assignment
template_name
=
'Assignments/assignment-details.html'
class
AssignmentsCreateView
(
CreateView
):
model
=
Assignment
fields
=
'__all__'
template_name
=
'Assignments/assignment-add.html'
'''
def index(request):
head_string = "<h1>Widget's Assignment Page</h1>"
...
...
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