本文介绍了django中的Model.id和Model.pk有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候我看到django文件有用吗?是否相同?有什么区别,参考在哪里?我只看到pk的文件。



BTW,django引用覆盖了所有类的方法?

解决方案

pk 是。


I saw the django documents use both sometimes? Are they identical? What's the difference and where is the reference? I only see document of pk.

BTW, does django reference cover all the methods of it's classes?

解决方案

pk is the attribute that contains the value of the primary key for the model. id is the name of the field created as a primary key by default if none is explicitly specified.

这篇关于django中的Model.id和Model.pk有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 07:08
查看更多