Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个模型 Foo,它将有一个字段让我们称之为“parameters_names”。我想保存这个模型,然后用这些 paramaters_names 作为新模型的字段创建一个新模型。
所以例如Foo:
参数:“姓名、姓氏、身份证号”
NEW MODEL: name = CharField() surname = CharField() id_number = CharField()
所以新模型可能总是不同的。
这个怎么样?
model FooParams: foo = ForeignKey(Foo) param = CharField() value = CharField()