0
我遵循接受的答案here来更改我的Django管理中的外键选择列表中项目的顺序。重新排序的效果很好,但添加图标在选择列表后消失了。我怎样才能找回来?声明自定义表单域将删除添加图标
class GameForm(forms.ModelForm):
publisher = forms.ModelChoiceField(queryset=Publisher.objects.order_by('name'))
platform = forms.ModelChoiceField(queryset=Platform.objects.order_by('platform'))
class Meta:
model = Game
class GameAdmin(admin.ModelAdmin):
list_display = ('name','platform','publisher','age_rating','buy_date','pub_date')
form = GameForm
admin.site.register(Game, GameAdmin)