In my Django application, the user provides a unique product name that matches a field of another object and then displays the second object on the list (that the user sees). So the object's display condition looks something like this
obj1.name == obj2.name
It is extremely simple for one object but how to use it to get queryset (where the field of objects 1 is equal to the field of object 2)?
An example of the effect I want to get:
Obj1.objects.all() = ('AS2', 'AS9', 'AD5', 'AG1')
Obj2.objects.all() = ('DD1', 'AS2', 'AS9', 'AP33', 'AD5', 'AG1', 'KQ1', 'LG4')
query1 = Obj1.objects.all()
query2 = obj2.objects.filter(name=???)
#and query2 return all objects product which name=name well ('AS2', 'AS9', 'AD5', 'AG1') but from Obj2