Фильтрация по приоритету Djnago
def get_context_data(self, **kwargs):
Priorities.objects.all().order_by('-id')
context = super(TaskDetailView, self).get_context_data(**kwargs)
context['statuses'] = Status.objects.all()
context['comments'] = Comment.objects.all()
return context
class Priorities(models.Model):
priorities_name = models.CharField(max_length=255)
code = models.CharField(max_length=50, null=True)
priority = models.ForeignKey(to=Priorities, related_name="task", on_delete=models.PROTECT)
Вернуться на верх