success: function (data) {
var current_group = form.closest('.custom-list-group')
if (data.form_is_valid) {
current_group.find("#task-comments").html(data.html_task_comment);
}
else {
current_group.find("#task-comment-form").html(data.html_task_comment_form);
}
}
class LastViewedComment(models.Model):
user
task
comment = models.foreignkey(Comment, null=True)
А во вьюхе добавить
last_comment = LastViewedComment.objects.get_or_create(user=request.user, task=task)
last_comment.comment = последнему комментарии
last_comment.save()