擅长:python、mysql、java
<p>关于使用“instance”对象的pk值的说明。根据文件:</p>
<blockquote>
<p>In most cases, this object will not have been saved to the database yet, so if it uses the default AutoField, it might not yet have a value for its primary key field.</p>
</blockquote>
<p>因此,使用pk的有效性取决于如何定义您的特定模型。</p>