There are two models from different applications, such as:
model1.py
class SomeClass1(models.Model): short_name = models.CharField(...) compatibility = models.ManyToManyField(SomeClass2, ....) model2.py
class SomeClass2(models.Model): name_dev = models.CharField(...) Actually, when I create a model1 object, I can select related objects from model2 . And in the template I can {{object.compatibility.name_dev}} type - {{object.compatibility.name_dev}}
But also in the template I would like to get all the objects that referred to the associated object from model2
It is possible that something like this:
views2.py
object2 = SomeClass2.objects.all() In the template:
{% for object in object2 %}
`{{object.(...)compatibility.short_name}}` {% endfor %}
You can add a field to the second model, but this will again have to manually select objects from model1 . This is what I would like to avoid.