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> 
  • It seems it should work that way. Are you getting any specific errors? - FeroxTL
  • There are no errors, but the proxy models retain the connections of the original models and do not work with each other. The solution for one-to-many and many-to-many links I found on the network, but for the rest nothing works. - Mr Fix
  • For more than 7 years, the ticket has been hanging on this topic. Indeed, there is no such thing yet, it is solved with a crutch, it is written in the same ticket. code.djangoproject.com/ticket/10961 - FeroxTL
  • Well, on the ticket there is a solution for one-to-many. But for the many-to-one, I can not find anything. Own is not enough, unfortunately. - Mr. Fix

0