Есть модель:
class Log_Book(models.Model):
department = models.ForeignKey(Department)
in_request = models.DateTimeField()
who_accept = models.CharField(max_length=35)
office = models.CharField(max_length=30)
problem = models.CharField(max_length=300)
check_off = models.CharField(max_length=1, choices=CHECK_CHOICES)
out_request = models.DateTimeField()
action_problem = models.CharField(max_length=300)
who_corrected = models.CharField(max_length=35, blank=True)
remark = models.CharField(max_length=300, blank=True)
def view_logbook(request):
log_books = Log_Book.objects.all(),
return render_to_response('project_db/view.html',{'log_books': log_books})
<table >
<tr >
<td>Дирекция,отдел,служба</td>
<td>Поступлениe заявки</td>
<td>Принял</td>
<td>Офис,№ комн.</td>
<td>Проблема</td>
<td>Отметка о выполнении</td>
</tr>
{% for log_book in log_books.list %}
<tr >
<td>{{ log_book.department }}</td>
<td>{{ log_book.in_request }}</td>
<td>{{ log_book.who_accept }}</td>
<td>{{ log_book.office }}</td>
<td>{{ log_book.problem }}</td>
</tr>
{% endfor %}
</table>