0

我的 Django 网站中有两个应用程序,一个称为 Playlist,它具有 Song 模型,而后者又具有 BooleanField。另一个应用程序称为 Spotlight,并具有 Track 模型。在 Track 模型中,我只想显示 BooleanField 值等于 True 的歌曲(播放列表应用程序的)。我知道如何通过使用过滤器在网页中做到这一点,但我不知道如何在管理面板中实现这一点。我怎样才能做到这一点?谢谢

4

1 回答 1

0

假设你有一个ForeignKeyor ManyToManyField,你想要limit_choices_to.

于 2012-05-03T17:02:19.130 回答