我有一个目录,可以保存django admin(由models.ForeignKey调用)中任何“表格”中的所有地址,并带有街道,数字,城市,这没关系-但我想保存字段名称(或类,或文件名之类的东西)调用了此地址方法,以将地址信息与有关所要求的来源的任何参考一起保存
class TraderClass(models.Model):
trader_ID = models.AutoField(primary_key=True)
caller #1
address_enterprise = models.ForeignKey(AddressClass, on_delete=models.CASCADE, default=None, verbose_name='Address')
class EnterpriseClass(models.Model):
enterprise_ID = models.AutoField(primary_key=True)
caller #2
address_project = models.ForeignKey(AddressClass, on_delete=models.CASCADE, default=None, verbose_name='Address')
地址
class AddressClass(models.Model):
ID = models.AutoField(primary_key=True)
address_source = models.CharField(max_length=32,
default=__qualname__,verbose_name='Origin')
\__qualname\__
仅显示相同的类“ AddressClass”,我需要类似TraderClass/EnterpriseClass
或address_enterprise/address_project
之类的东西或我可以用该地址保存的任何东西