class MyUser(AbstractBaseUser):
...
content_type = models.ForeignKey(ContentType, limit_choices_to={"model__in": ("agentprofile", "clientprofile"))
object_id = models.PositiveIntegerField()
profile = generic.GenericForeignKey('content_type', 'object_id')
class AgentProfile(models.Model):
license_number = models.CharField(max_length=50, blank=True)
class ClientProfile(models.Model):
address = models.CHarField(max_length=250)
我有 3 个模型:MyUser(自定义用户模型)、ClientProfile、AgentProfile。如何在 MyUser 管理页面(如内联)上编辑 ClientProfile/AgentProfile?