擅长:python、mysql、java
<p>正如@DanielRosman在他的评论中指出的,您必须将<code>ArticleStatManager</code>设置为<a href="https://docs.djangoproject.com/en/2.1/topics/db/managers/#default-managers" rel="nofollow noreferrer">default manager</a>(您需要通过属性<code>objects</code>来设置它,因此它必须是默认的管理器)</p>
<pre><code>class ArticleStat(models.Model):
objects = ArticleStatManager()
</code></pre>
<p>您也可以为此设置不同的管理器:</p>
^{pr2}$
<p>然后你可以:</p>
<pre><code>ArticleStat.articlesmanager.save_main_article(article)
</code></pre>