例子:
A表的aa字段值为0,1
B表的bb字段值为no,yes
然后输出A表信息的时候,aa字段0或1,选择输出B表的yes或no。就是输出A表时,aa字段内容需要改为B表的bb字段内容。
想问怎么写,也设置了外键。谢谢了
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
クラス A(model.Model): type=( (1,1), (2,2) ) name = model.IntegerFiled(choice=type ) b=model.ForikeyFiled('B',関連名='b_a')
クラス B(model.Model): type=( (1,'yes'), (2,'No') ) name = model.IntegerFiled (choice=type) b=name.b.all()
一例
リーリー
クラス A(model.Model):
type=(
(1,1),
(2,2)
)
name = model.IntegerFiled(choice=type )
b=model.ForikeyFiled('B',関連名='b_a')
クラス B(model.Model):
type=(
(1,'yes'),
(2,'No')
)
name = model.IntegerFiled (choice=type)
b=name.b.all()
一例
リーリー