Django workflow to convert model superclass to subclass

前端 未结 1 1789
Happy的楠姐
Happy的楠姐 2021-01-21 07:26

I have a Django project with two models: Applicant and Client, where Client is a subclass of Applicant. I would like some way of allowing a user to add an existing Applicant ins

1条回答
  •  鱼传尺愫
    2021-01-21 08:03

    You can create a Client instance from an existing Applicant instance with the following code:

    client = Client(applicant_ptr=applicant)
    client.save_base(raw=True)
    

    0 讨论(0)
提交回复
热议问题