i would like to merge two QuerySets on two keys.

```
class ModelA(models.Model)
  text = models.CharField(max_length=10)

class ModelB(models.Model)
  value = models.CharField(max_length=10)
  model_a = models.ForeignKey(ModelA)
  additionalkey =  models.CharField(max_length=10)  

```

Suppose i already have a queryset on all ModelA-objects and I need corresponding entries from a second Model (ModelB) which has a ForeignKey-RelationShip to ModelA depending on an additional key. What would be the fastest and most efficient way to achieve this?

Doing this with a loop over all entries would hit the database for every entry in the ModelA-QuerySet.

My idea is to get all ModelB Objects at once and join/merge it with the complete ModelA-set where the ForeignKey and the additionalkey fit.

Any ideas or hints anyone?

Edit: 

Ok, to be more precise. I *already have* a queryset of ModelA. After all I would like to have a queryset with informations from both tables in *one queryset* (or something else i can iterate over in a template).