If I have a list of objects received by some request (in this case, Django models).
friends = Friend.objects.friends(user1)
How can I get a list of identifiers, so I can use it to search for another model, for example:
items = Item.objects.get(pk__in=friends_ids).order_by('date')
I'm sure lambda expressions should be able to do this, but I can't figure it out ...
source
share