擅长:python、mysql、java
<p>我使用的是<code>admin.widgets.ForeignKeyRawIdWidget</code><a href="https://github.com/django/django/blob/master/django/contrib/admin/widgets.py" rel="nofollow noreferrer">widget</a>,它阻止外键字段正常显示。因为</p>
<pre><code>content_type = models.ForeignKey(ContentType, limit_choices_to=FEATURE_LIMITS, on_delete=models.CASCADE)
</code></pre>
<p>content_type是外键字段,没有下拉列表。
为了防止这种情况发生,请在管理员py公司名称:</p>
^{pr2}$