回答編集履歴

1

add

2017/11/30 09:22

投稿

mkgrei
mkgrei

スコア8560

test CHANGED
@@ -9,3 +9,15 @@
9
9
 
10
10
 
11
11
  https://stackoverflow.com/questions/43959790/how-do-i-include-the-id-field-in-a-django-form
12
+
13
+
14
+
15
+ ---
16
+
17
+ > If you’d like to specify a custom primary key, just specify primary_key=True on one of your fields. If Django sees you’ve explicitly set Field.primary_key, it won’t add the automatic id column.
18
+
19
+
20
+
21
+ とあるので、主キーがあるとidは自動生成されないようです。
22
+
23
+ 何かのキーを主キーとして登録してみて、エラーが出ないか検証してみるとよいと思います。