草庐IT

hwChoices

全部标签

mysql - 在 View 中执行的 Django 查询返回旧数据

我有一个查询模型以填充表单的View:classAddServerForm(forms.Form):…snip…#CompileandpresentchoicesforHARDWARECONFIGhwChoices=HardwareConfig.objects.\values_list('name','description').order_by('name')hwChoices=[('','-----SELECTONE-----')]+\[(x,'{0}-{1}'.format(x,y))forx,yinhwChoices]hwconfig=forms.ChoiceField(lab