Assuming Blabla has fields in your question as well as field4 ,
Blabla.objects.only('field1', 'field2', 'field3')[0].field4
will return the value of this field4 object (with a new database query to get this information), whereas
Blabla.objects.values('field1', 'field2', 'field3')[0].field4
will give
AttributeError: 'dict' object has no attribute 'field4'
This is because .values() returns a ValuesQuerySet based on an existing QuerySet , which is essentially a list of dicts (in the sense that a regular QuerySet is a list of Blabla objects).
source share