python - How can I filter instances of a model in django, with a queryset value of filter field? -


i creating application in django, , have next question:

i want filet objects of modela, field att1, , have queryset of values of field att1. mean, models are:

class modela(models.model):     att1 = models.foreignkey(modelb)     ...  class modelb(models.model):     ... 

i got queryset ot objects of modelb, , want objects of modela has value of att1, of values of queryset of modelb.

how can it?

thank much!

nothing magic

modela.objects.filter(att1=queryset of modelb) 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -