Not sure if it's possible or not but can the ORM resolve a related object on annotations of id?
Table definitions
Table Foo:
id
Table Bar
id
queryset = Foo.objects.annotate(
bar_id=Subquery(Bar.objects.values('id')[:1])
)
queryset[0].bar.id # Like so
I'm sure the given snippet of code doesn't work. I'm asking if there's a way to do that other than looping through the queryset and getting the object itself.