Answers for "AttributeError: 'QuerySet' object has no attribute django"

0

AttributeError: 'QuerySet' object has no attribute django

#Method .filter() return a Queryset, from there is impossible to access 
#any of his fields.
#Use .get() instead.
#Example
#Instead of:
name = User.objects.filter(username='MitchAloha').first_name 
#Use
name = User.objects.get(username='MitchAloha').first_name
Posted by: Guest on January-23-2022

Code answers related to "AttributeError: 'QuerySet' object has no attribute django"

Python Answers by Framework

Browse Popular Code Answers by Language