Is it possible to set up a proxy model to work with another proxy model, for one-to-one and many-to-one connections, so that the admin works fine?
Ie, I would like full compatibility of the solution with Django.
class Модель_1(models.Model): поле = models.IntegerField() class Модель_2(models.Model): модель_1 = models.ForeignKey(Модель_1, related_name="модели_1") class ПроксиМодель_1(models.Model): class Meta: proxy = True class ПроксиМодель_2(models.Model): class Meta: proxy = True
I want to get this result:
пм = ПроксиМодель_2.objects.get() print(пм.модель_1) <ПроксиМодель_1: object>