I have simple model:
class User(models.Model):
group_uuid = models.UUIDField(default=uuid.uuid4)
Let say i have only available user_id, and I need to retrieve all the users that has the same group_uuid as user id of which I have in user_id variable.
Not sure if we can utilize F or Subquery object in some ways.
So we want to achieve this in one query:
user = User.objects.get(id=user_id)
User.objects.filter(group_uuid=Subquery(user))
This obviously is NOT making one query, but it should be possible to make it in one right?