| | 1376 | You can also use a queryset to dynamically evaluate the list of values |
|---|
| | 1377 | instead of providing a list of literal values. The queryset must be |
|---|
| | 1378 | reduced to a list of individual values using the ``values()`` method, |
|---|
| | 1379 | and then converted into a query using the ``query`` attribute:: |
|---|
| | 1380 | |
|---|
| | 1381 | Entry.objects.filter(blog__in=Blog.objects.filter(name__contains='Cheddar').values('pk').query) |
|---|
| | 1382 | |
|---|
| | 1383 | This queryset will be evaluated as subselect statement:: |
|---|
| | 1384 | |
|---|
| | 1385 | SELET ... WHERE blog.id IN (SELECT id FROM ... WHERE NAME LIKE '%Cheddar%') |
|---|
| | 1386 | |
|---|