[英]How to enumerate new column?
In my Django admin I have a TabularInLine
class. 在我的Django管理员中,我有一个
TabularInLine
类。 In the picture, each element of this class is numbered with it's own ID
. 在图片中,此类的每个元素都用自己的
ID
。 This TabularInLine
class has a foreign key to an other class (class Part
). 此
TabularInLine
类具有另一个类( Part
类)的外键。 How I can to numerate that for each FK
with the numbering ( my_id
) started from 1 as in the picture below? 如何为每个
FK
编号,编号( my_id
)从1开始,如下图所示?
you can define your own insert
operation which does those steps: 您可以定义自己的
insert
操作,执行以下步骤:
let's say you already have that table in your database. 假设您的数据库中已经有该表。 you want to add a new entry to database, which has
FK="three"
. 您想要向数据库添加一个新条目,该条目具有
FK="three"
。
FK="three"
). FK="three"
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.