I have a project and a task model and I want to make a table in a detail html that displays the tasks in the project.
I've tried doing
<table>
<tr>
<th>Name</th>
<th>Assignee</th>
<th>Start Date</th>
<th>Due Date</th>
<th>Is compeleted</th>
</tr>
<tr>
<td>{{ task.name }} </td>
<td>{{ task.assignee }}</td>
<td>{{ task.start_date }}</td>
<td>{{ task.due_date }}</td>
<td>{{ task.is_completed }}</d>
</tr>
</table>
but it just shows the table headers and not its content
here is my task model
from django.db import models
from django.conf import settings
from django.urls import reverse
# Create your models here.
class Task(models.Model):
name = models.CharField(max_length=200)
start_date = models.DateTimeField()
due_date = models.DateTimeField()
is_completed = models.BooleanField(default=False)
project = models.ForeignKey(
"projects.Project",
related_name="tasks",
on_delete=models.CASCADE,
)
assignee = models.ForeignKey(
settings.AUTH_USER_MODEL,
null=True,
related_name="tasks",
on_delete=models.SET_NULL,
)
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse("show_my_tasks")