如何通过字段访问API(get_field)获取特定数据字段?
- 内容介绍
- 文章标签
- 相关推荐
本文共计2667个文字,预计阅读时间需要11分钟。
margin: 0px; padding: 0px; font-weight: normal; line-height: 15.4px;获取字段值:使用 get_field 方法返回指定字段名称的值。
de style="margin: 0px; padding: 0px; font-weight: normal; line-height: 15.4px;" >Options.de>de style="margin: 0px; padding: 0px; font-weight: normal; line-height: 15.4px;" >get_fieldde>(field_name)[source]
返回给定字段名称的字段实例。
de style="margin: 0px; padding: 0px; line-height: 14px; color: rgb(35, 79, 50); white-space: nowrap;" >field_namede>可以是模型上的字段名称,抽象或继承模型上的字段,或在指向模型的另一个模型上定义的字段。在后一种情况下,de style="margin: 0px; padding: 0px; line-height: 14px; color: rgb(35, 79, 50); white-space: nowrap;" >field_namede>将是由用户定义的de style="margin: 0px; padding: 0px; line-height: 14px; color: rgb(35, 79, 50); white-space: nowrap;" >related_namede>或由Django本身自动生成的名称。
本文共计2667个文字,预计阅读时间需要11分钟。
margin: 0px; padding: 0px; font-weight: normal; line-height: 15.4px;获取字段值:使用 get_field 方法返回指定字段名称的值。
de style="margin: 0px; padding: 0px; font-weight: normal; line-height: 15.4px;" >Options.de>de style="margin: 0px; padding: 0px; font-weight: normal; line-height: 15.4px;" >get_fieldde>(field_name)[source]
返回给定字段名称的字段实例。
de style="margin: 0px; padding: 0px; line-height: 14px; color: rgb(35, 79, 50); white-space: nowrap;" >field_namede>可以是模型上的字段名称,抽象或继承模型上的字段,或在指向模型的另一个模型上定义的字段。在后一种情况下,de style="margin: 0px; padding: 0px; line-height: 14px; color: rgb(35, 79, 50); white-space: nowrap;" >field_namede>将是由用户定义的de style="margin: 0px; padding: 0px; line-height: 14px; color: rgb(35, 79, 50); white-space: nowrap;" >related_namede>或由Django本身自动生成的名称。

