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
Post a Comment