主矩-数据库方案不是从头开始设计的。它是从遗留系统继承而来的,必须保持当前的状态,因为它还与一些外部系统共享。所以我们有:
class A(models.Model):
"""
List of 110 fields
"""
field_1 = models.CharField()
field_... = models.CharField()
field_n = models.CharField()
有没有办法让模型B成为代理模型,并且有有限的字段集?在
比如:
^{pr2}$我目前想到的唯一解决方案是创建一些非托管模型。但是代理模型看起来更适合这个目标。。还是没有?在
根据docs的说法,代理模型并不是您想要的
最好的办法是在SQL中创建一个只列出所需字段的视图,然后使用非托管表连接到该视图。在
相关问题 更多 >
编程相关推荐