gpt4 book ai didi

Django 2 模型 1 形式

转载 作者:行者123 更新时间:2023-12-02 05:37:10 25 4
gpt4 key购买 nike

所以,我仍然是 Django 的菜鸟,我想知道如何执行以下操作:

所以假设我有类似下面的代码:

class UserProfile(models.Model):
#Some fields
class UserProfileOther(models.Model):
#Some other fields that I want in another table for organization
user_profile = models.OneToOneField(UserProfile)

我现在如何创建包含上述两种模型的表单?

最佳答案

这种问题是什么inline formsets专为。

关于Django 2 模型 1 形式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11512972/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com