我有这个字段:
city = forms.ModelChoiceField(label="city", queryset=MyCity.objects.all())
district = forms.ModelChoiceField(label="district", queryset=MyDistrict.objects.all())
area = forms.ModelChoiceField(label="area", queryset=MyArea.objects.all())
区来自点击城市,面积来自点击区域。搭配 queryset=MyDistrict.objects.all()
和queryset=MyArea.objects.all()
形式会很沉重。默认情况下如何使查询集为空?