djandgo model id
生活随笔
收集整理的這篇文章主要介紹了
djandgo model id
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
django 關于model id:
Automatic primary key fields By default, Django gives each model the following field:id = models.AutoField(primary_key=True) This is an auto-incrementing primary key.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.Each model requires exactly one field to have primary_key=True.來源:http://django-chinese-docs.readthedocs.org/en/latest/topics/db/models.html#automatic-primary-key-fields
轉載于:https://www.cnblogs.com/littlefire/p/3647188.html
總結
以上是生活随笔為你收集整理的djandgo model id的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 非maven项目转成maven后pom.
- 下一篇: Eclipse设置字体大小等!