Commit 16231c67 authored by Bianca Aguilar's avatar Bianca Aguilar

Fixing conflicts on my end

parents c70d42ce 6e231563
<<<<<<< HEAD
# Generated by Django 4.0.3 on 2022-05-19 15:51
=======
# Generated by Django 4.0.3 on 2022-05-18 05:18 # Generated by Django 4.0.3 on 2022-05-18 05:18
>>>>>>> e8302eda5a5b3d0f12807e7cd55e42d4b2a3be23
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
......
# 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): ...@@ -24,6 +24,8 @@ class Assignment(models.Model):
course = models.ForeignKey(Course, on_delete = models.CASCADE) course = models.ForeignKey(Course, on_delete = models.CASCADE)
image = models.ImageField(upload_to='images')
@property @property
def passing_score(self): def passing_score(self):
return self.max_points * 0.60 return self.max_points * 0.60
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
{% block content %} {% block content %}
<ul> <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> <li><p class="course_section">{{ c.course_code }} {{ c.course_title }} {{ c.section }}</p>
<ul class="course_assignments"> <ul class="course_assignments">
{% for a in assignment_list %} {% for a in assignment_list %}
......
...@@ -11,4 +11,5 @@ ...@@ -11,4 +11,5 @@
<p class="desc">{{ object.description }}</p> <p class="desc">{{ object.description }}</p>
<p class="score">Perfect Score: {{ object.max_points }}</p> <p class="score">Perfect Score: {{ object.max_points }}</p>
<p class="score">Passing Score: {{ object.passing_score }}</p> <p class="score">Passing Score: {{ object.passing_score }}</p>
<img src= "{{ object.image }}">
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -4,7 +4,7 @@ from .views import AssignmentsPageView, AssignmentDetailView ...@@ -4,7 +4,7 @@ from .views import AssignmentsPageView, AssignmentDetailView
urlpatterns = [ urlpatterns = [
path('', AssignmentsPageView.as_view(), name='index'), 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" app_name = "assignments"
\ No newline at end of file
...@@ -126,6 +126,11 @@ USE_TZ = True ...@@ -126,6 +126,11 @@ USE_TZ = True
STATIC_URL = 'static/' STATIC_URL = 'static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'widget_group_23/static')] STATICFILES_DIRS = [os.path.join(BASE_DIR, 'widget_group_23/static')]
STATIC_ROOT = os.path.join(BASE_DIR, 'widget_group_23/staticfiles')
MEDIA_URL = '/media'
MEDIA_ROOT = os.path.join(BASE_DIR, 'widget_group_23/media')
# Default primary key field type # Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
......
...@@ -18,6 +18,9 @@ from django.urls import include, path ...@@ -18,6 +18,9 @@ from django.urls import include, path
from django.conf import settings from django.conf import settings
from django.conf.urls.static import static from django.conf.urls.static import static
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [ urlpatterns = [
path('homepage/', include('homepage.urls', namespace="homepage")), path('homepage/', include('homepage.urls', namespace="homepage")),
path('forum/', include('forum.urls', namespace="forum")), path('forum/', include('forum.urls', namespace="forum")),
...@@ -25,3 +28,6 @@ urlpatterns = [ ...@@ -25,3 +28,6 @@ urlpatterns = [
path('announcements/', include('announcements.urls', namespace="announcements")), path('announcements/', include('announcements.urls', namespace="announcements")),
path('admin/', admin.site.urls), 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