Commit 2fbda415 authored by Bianca Aguilar's avatar Bianca Aguilar

Fixing conflicts

parents 4c3f5df5 c794d226
# Generated by Django 4.0.3 on 2022-05-18 05:18
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('announcements', '0003_reaction_reaction_name'),
]
operations = [
migrations.AlterField(
model_name='reaction',
name='announcement',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reacts', to='announcements.announcement'),
),
]
# Generated by Django 4.0.3 on 2022-05-19 15:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assignments', '0003_assignment_course'),
]
operations = [
migrations.AddField(
model_name='assignment',
name='image',
field=models.ImageField(default=1, upload_to='images'),
preserve_default=False,
),
]
......@@ -24,6 +24,8 @@ class Assignment(models.Model):
course = models.ForeignKey(Course, on_delete = models.CASCADE)
image = models.ImageField(upload_to='assignments/')
@property
def passing_score(self):
return self.max_points * 0.60
......
......@@ -9,7 +9,7 @@
{% block content %}
<ul>
{% for c in course_list %}
{% for c in course_list|dictsort:"course_code" %}
<li><p class="course_section">{{ c.course_code }} {{ c.course_title }} {{ c.section }}</p>
<ul class="course_assignments">
{% for a in assignment_list %}
......
......@@ -8,7 +8,10 @@
{% block content %}
<p class="course">{{ object.course.course_code }} {{ object.course.course_title }} {{ object.course.section }}</p>
<p class="title">{{ object.name }}</p>
<p class="desc">{{ object.description }}</p>
<p class="score">Perfect Score: {{ object.max_points }}</p>
<p class="score">Passing Score: {{ object.passing_score }}</p>
<img src= "{{ object.image.url }}">
<div class="assign_details">
<p class="desc">{{ object.description }}</p>
<p class="score">Perfect Score: {{ object.max_points }}</p>
<p class="score">Passing Score: {{ object.passing_score }}</p>
</div>
{% endblock %}
\ No newline at end of file
......@@ -4,7 +4,7 @@ from .views import AssignmentsPageView, AssignmentDetailView
urlpatterns = [
path('', AssignmentsPageView.as_view(), name='index'),
path('<int:pk>/details', AssignmentDetailView.as_view(), name='assignment-detail'),
path('assignment/<int:pk>/details', AssignmentDetailView.as_view(), name='assignment-detail'),
]
app_name = "assignments"
\ No newline at end of file
<<<<<<< HEAD
# Generated by Django 4.0.3 on 2022-05-19 16:53
=======
# Generated by Django 4.0.3 on 2022-05-19 16:08
>>>>>>> master
from django.db import migrations, models
......@@ -13,7 +17,11 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='post',
name='image',
<<<<<<< HEAD
field=models.ImageField(default=1, upload_to='forum/images/'),
=======
field=models.ImageField(default=1, upload_to='images/'),
>>>>>>> master
preserve_default=False,
),
]
<<<<<<< HEAD
# Generated by Django 4.0.3 on 2022-05-19 16:58
=======
# Generated by Django 4.0.3 on 2022-05-19 16:13
>>>>>>> master
from django.db import migrations, models
......@@ -13,6 +17,10 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='post',
name='image',
<<<<<<< HEAD
field=models.ImageField(upload_to='forum/'),
=======
field=models.ImageField(upload_to='forum/images/'),
>>>>>>> master
),
]
......@@ -10,7 +10,11 @@ class Post(models.Model):
'homepage.WidgetUser',
on_delete=models.CASCADE
)
<<<<<<< HEAD
image = models.ImageField(upload_to='forum/')
=======
image = models.ImageField(upload_to="forum/images/")
>>>>>>> master
def __str__(self):
return '{}'.format(self.post_title)
......
......@@ -21,4 +21,5 @@
{% endfor %}
</ul>
</div>
{% endblock %}
\ No newline at end of file
{% endblock %}
......@@ -15,6 +15,11 @@ Including another URLconf
"""
from django.contrib import admin
from django.urls import include, path
from django.conf import settings
from django.conf.urls.static import static
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('homepage/', include('homepage.urls', namespace="homepage")),
......@@ -23,3 +28,6 @@ urlpatterns = [
path('announcements/', include('announcements.urls', namespace="announcements")),
path('admin/', admin.site.urls),
]
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment