擅长:python、mysql、java
<p>您需要告诉模型使用自定义模型管理器。在</p>
<pre><code>class ArticleStat(models.Model):
objects = ArticleStatManager()
</code></pre>
<p><a href="https://docs.djangoproject.com/en/2.2/topics/db/managers/#adding-extra-manager-methods" rel="nofollow noreferrer">(DOCS)</a></p>