Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_vincentdjango
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
1
Merge Requests
1
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
Almira Redoble
midterm_vincentdjango
Commits
cf2f23e6
Commit
cf2f23e6
authored
May 12, 2023
by
Star Neptune R. Sy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed label error in the dropdowns of edit and add
parent
1e5878cf
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
105 additions
and
12 deletions
+105
-12
admin.py
widget_vincentdjango/assignments/admin.py
+3
-3
0008_remove_assignment_coursedropdown.py
...ments/migrations/0008_remove_assignment_coursedropdown.py
+17
-0
models.py
widget_vincentdjango/assignments/models.py
+6
-6
assignment-details.html
...assignments/templates/assignments/assignment-details.html
+1
-1
views.py
widget_vincentdjango/assignments/views.py
+2
-2
db.sqlite3
widget_vincentdjango/db.sqlite3
+0
-0
0008_alter_forumpost_pub_datetime.py
...ngo/forum/migrations/0008_alter_forumpost_pub_datetime.py
+19
-0
0009_alter_forumpost_pub_datetime.py
...ngo/forum/migrations/0009_alter_forumpost_pub_datetime.py
+19
-0
0014_alter_event_target_datetime.py
...t_calendar/migrations/0014_alter_event_target_datetime.py
+19
-0
0015_alter_event_target_datetime.py
...t_calendar/migrations/0015_alter_event_target_datetime.py
+19
-0
No files found.
widget_vincentdjango/assignments/admin.py
View file @
cf2f23e6
...
@@ -17,9 +17,9 @@ class AssignmentAdmin(admin.ModelAdmin):
...
@@ -17,9 +17,9 @@ class AssignmentAdmin(admin.ModelAdmin):
class
CourseAdmin
(
admin
.
ModelAdmin
):
class
CourseAdmin
(
admin
.
ModelAdmin
):
model
=
Course
model
=
Course
list_display
=
(
'course_code'
,
'course_title'
,)
list_display
=
(
'course_code'
,
'course_title'
,
'section'
,
)
search_fields
=
(
'course_code'
,
'course_title'
,)
search_fields
=
(
'course_code'
,
'course_title'
,
'section'
,
)
list_filter
=
(
'course_code'
,
'course_title'
,)
list_filter
=
(
'course_code'
,
'course_title'
,
'section'
,
)
admin
.
site
.
register
(
Course
,
CourseAdmin
)
admin
.
site
.
register
(
Course
,
CourseAdmin
)
...
...
widget_vincentdjango/assignments/migrations/0008_remove_assignment_coursedropdown.py
0 → 100644
View file @
cf2f23e6
# Generated by Django 3.2 on 2023-05-12 06:43
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'assignments'
,
'0007_auto_20230512_1428'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'assignment'
,
name
=
'courseDropDown'
,
),
]
widget_vincentdjango/assignments/models.py
View file @
cf2f23e6
...
@@ -7,6 +7,9 @@ class Course(models.Model):
...
@@ -7,6 +7,9 @@ class Course(models.Model):
section
=
models
.
CharField
(
default
=
""
,
max_length
=
16
,)
section
=
models
.
CharField
(
default
=
""
,
max_length
=
16
,)
def
__str__
(
self
):
def
__str__
(
self
):
return
'{} {}'
.
format
(
self
.
course_code
,
self
.
section
,)
def
anotherFormat
(
self
):
return
'{} {}'
.
format
(
self
.
course_code
,
self
.
course_title
,)
return
'{} {}'
.
format
(
self
.
course_code
,
self
.
course_title
,)
...
@@ -20,18 +23,15 @@ class Assignment(models.Model):
...
@@ -20,18 +23,15 @@ class Assignment(models.Model):
on_delete
=
models
.
CASCADE
,
on_delete
=
models
.
CASCADE
,
related_name
=
'subject'
related_name
=
'subject'
)
)
courseDropDown
=
models
.
CharField
(
unique
=
True
,
default
=
""
,
max_length
=
100
,
blank
=
True
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'{} {}-'
.
format
(
self
.
assignment_name
,
self
.
section
,)
return
'{} {}-'
.
format
(
self
.
assignment_name
,
self
.
course
.
section
,)
def
get_absolute_url
(
self
):
def
get_absolute_url
(
self
):
return
'{}'
.
format
(
self
.
pk
)
return
'{}'
.
format
(
self
.
pk
)
def
save
(
self
,
*
args
,
**
kwargs
):
def
save
(
self
,
*
args
,
**
kwargs
):
self
.
courseDropDown
=
'{} - {}'
.
format
(
self
.
course
.
course_code
,
self
.
section
)
self
.
passing_score
=
self
.
perfect_score
*
0.6
super
()
.
save
(
*
args
,
**
kwargs
)
# Call the "real" save() method.
super
(
Assignment
,
self
)
.
save
(
*
args
,
**
kwargs
)
widget_vincentdjango/assignments/templates/assignments/assignment-details.html
View file @
cf2f23e6
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
{% block heading %}
<h1
class=
"pageTitle"
>
{{object.assignment_name}}
</h1>
{% endblock %}
{% block heading %}
<h1
class=
"pageTitle"
>
{{object.assignment_name}}
</h1>
{% endblock %}
{% block content %}
{% block content %}
<h2>
{{object.course
}} - {{object
.section}}
</h2>
<h2>
{{object.course
.anotherFormat}} - {{object.course
.section}}
</h2>
<p>
<b>
Description:
</b>
{{object.description}}
<br>
<p>
<b>
Description:
</b>
{{object.description}}
<br>
<b>
Perfect Score:
</b>
{{object.perfect_score}}
<br>
<b>
Perfect Score:
</b>
{{object.perfect_score}}
<br>
<b>
Passing Score:
</b>
{{object.passing_score}}
<br>
<b>
Passing Score:
</b>
{{object.passing_score}}
<br>
...
...
widget_vincentdjango/assignments/views.py
View file @
cf2f23e6
...
@@ -20,7 +20,7 @@ class AssignmentsDetailView(DetailView):
...
@@ -20,7 +20,7 @@ class AssignmentsDetailView(DetailView):
class
AssignmentsUpdateView
(
UpdateView
):
class
AssignmentsUpdateView
(
UpdateView
):
model
=
Assignment
model
=
Assignment
fields
=
[
"assignment_name"
,
"description"
,
"course
DropDown
"
,
"perfect_score"
]
fields
=
[
"assignment_name"
,
"description"
,
"course"
,
"perfect_score"
]
template_name
=
"assignments/assignment-edit.html"
template_name
=
"assignments/assignment-edit.html"
success_url
=
"../details"
success_url
=
"../details"
...
@@ -28,7 +28,7 @@ class AssignmentsUpdateView(UpdateView):
...
@@ -28,7 +28,7 @@ class AssignmentsUpdateView(UpdateView):
class
AssignmentsCreateView
(
CreateView
):
class
AssignmentsCreateView
(
CreateView
):
model
=
Assignment
model
=
Assignment
fields
=
[
"assignment_name"
,
"description"
,
"course
DropDown
"
,
"perfect_score"
]
fields
=
[
"assignment_name"
,
"description"
,
"course"
,
"perfect_score"
]
template_name
=
"assignments/assignment-add.html"
template_name
=
"assignments/assignment-add.html"
def
get_success_url
(
self
):
def
get_success_url
(
self
):
...
...
widget_vincentdjango/db.sqlite3
View file @
cf2f23e6
No preview for this file type
widget_vincentdjango/forum/migrations/0008_alter_forumpost_pub_datetime.py
0 → 100644
View file @
cf2f23e6
# Generated by Django 3.2 on 2023-05-12 06:43
import
datetime
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'forum'
,
'0007_alter_forumpost_pub_datetime'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'forumpost'
,
name
=
'pub_datetime'
,
field
=
models
.
DateTimeField
(
default
=
datetime
.
datetime
(
2023
,
5
,
12
,
14
,
43
,
53
,
323691
),
editable
=
False
),
),
]
widget_vincentdjango/forum/migrations/0009_alter_forumpost_pub_datetime.py
0 → 100644
View file @
cf2f23e6
# Generated by Django 3.2 on 2023-05-12 06:46
import
datetime
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'forum'
,
'0008_alter_forumpost_pub_datetime'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'forumpost'
,
name
=
'pub_datetime'
,
field
=
models
.
DateTimeField
(
default
=
datetime
.
datetime
(
2023
,
5
,
12
,
14
,
46
,
44
,
130987
),
editable
=
False
),
),
]
widget_vincentdjango/widget_calendar/migrations/0014_alter_event_target_datetime.py
0 → 100644
View file @
cf2f23e6
# Generated by Django 3.2 on 2023-05-12 06:43
import
datetime
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'widget_calendar'
,
'0013_alter_event_target_datetime'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'event'
,
name
=
'target_datetime'
,
field
=
models
.
DateTimeField
(
default
=
datetime
.
datetime
(
2023
,
5
,
12
,
14
,
43
,
53
,
325690
)),
),
]
widget_vincentdjango/widget_calendar/migrations/0015_alter_event_target_datetime.py
0 → 100644
View file @
cf2f23e6
# Generated by Django 3.2 on 2023-05-12 06:46
import
datetime
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'widget_calendar'
,
'0014_alter_event_target_datetime'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'event'
,
name
=
'target_datetime'
,
field
=
models
.
DateTimeField
(
default
=
datetime
.
datetime
(
2023
,
5
,
12
,
14
,
46
,
44
,
132978
)),
),
]
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