diff --git a/CHANGELOG.org b/CHANGELOG.org index 0d48f4c..8330f7f 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -3,4 +3,6 @@ Init project. ** 0.2.0 <2023-07-12 Wed> Add simple tasks app. +** 0.2.1 <2023-07-12 Wed> + Add the tasks to be shown on the index page. diff --git a/tasks/views.py b/tasks/views.py index c976fd7..41ee6cd 100644 --- a/tasks/views.py +++ b/tasks/views.py @@ -1,6 +1,12 @@ from django.shortcuts import render +from .models import Task def index(request): - context = {} + tasks = Task.objects.all() + + context = { + 'tasks': tasks, + } + return render(request, 'tasks/index.html', context) diff --git a/templates/tasks/index.html b/templates/tasks/index.html index 36c7e54..db2565a 100644 --- a/templates/tasks/index.html +++ b/templates/tasks/index.html @@ -3,4 +3,19 @@ {% block content %}

Tasks

+ + + + + + + + {% for task in tasks %} + + + + + + {% endfor %} +
StatusNameDescription
{{ task.status }}{{ task.name }}{{ task.description | truncatewords:10 }}
{% endblock %}