User.objects.all() will return a queryset you can put it in a loop such as
users = User.objects.all()
for user in users:
user.first_name
And also there are other ways to get dict instead of queryset object but its up
to you.
Sent from my iPhone
> On 7 May 2020, at 2:46 PM, Mohsen
On Thursday, 7 May 2020 12:47:21 UTC+1, Mohsen Pahlevanzadeh wrote:
>
> User.objects.all() only returns one field, I need to others fields
> such as first_name or last_name.
>
> How can I access others field?
>
No it doesn't. It returns a queryset of objects, each of which has all the
User.objects.all() only returns one field, I need to others fields
such as first_name or last_name.
How can I access others field?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from
3 matches
Mail list logo