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

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -