Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 Django 网站中有两个应用程序,一个称为 Playlist,它具有 Song 模型,而后者又具有 BooleanField。另一个应用程序称为 Spotlight,并具有 Track 模型。在 Track 模型中,我只想显示 BooleanField 值等于 True 的歌曲(播放列表应用程序的)。我知道如何通过使用过滤器在网页中做到这一点,但我不知道如何在管理面板中实现这一点。我怎样才能做到这一点?谢谢
假设你有一个ForeignKeyor ManyToManyField,你想要limit_choices_to.
ForeignKey
ManyToManyField
limit_choices_to