inner_qs = Blog.objects.filter(name__contains='Ch').values('name')
entries = Entry.objects.filter(blog__name__in=inner_qs)

Django ORM (on the surface) always impresses me.

(Yeah, I had no idea I could plug a queryset into another queryset.)

@amiloradovsky More like DX (developer experience) in this case.

I know that Django sometimes turns the querysets into some garbage/unoptimized SQL, but I do like how easy it is to use.

Sign in to participate in the conversation
Functional Café

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!