Skip to content
Advertisement

django ‘dict’ object has no attribute ‘job_id’

I’ve got this code:

Even though value() is defined, I get the error 'dict' object has no attribute 'job_id' I guess the error will also be for pass_count, skip_count and fail_count

What am I supposed to do here?

Advertisement

Answer

Your query does not return a queryset with object instances, so you cannot refer to fields with a “.” It is caused by https://docs.djangoproject.com/en/4.0/ref/models/querysets/#values

You can either edit your code or remove values, only then will you get the object’s own fields too.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement