[Answer]-Django not reading database values correctly

1👍

Remove the object_list from your class definition and move it to your get_context_data method:

def get_context_data(self, **kwargs):
    context = super(TaskCreateView, self).get_context_data(**kwargs)
    context['create_form'] = self.get_form(self.form_class)
    context['object_list'] = Task.objects.all()
    return context

0👍

You shouldn’t be defining object_list at the class level, but queryset or model.

Leave a comment