我使用的是Django Forms,在我的创建表单中,我希望用户在select choices字段中选择一个category字段,然后我要获取与该类别相关的所有功能并在下面的下拉列表中显示所有功能
my_drive_module(forms.Form)类: drives_a = [chr(x)+':'如果os.path.exists(chr(x)+':')则x在范围(65,90)中
list_with_tuples = [(x, x) for x in drives_a]
EMPTY_CHOICES = [('', 'All')] + list_with_tuples
Production_Drive = forms.CharField(widget=forms.RadioSelect(choices=list_with_tuples))
pro_folder= forms.CharField(label='Drive folder', widget=forms.Select(choices=EMPTY_CHOICES),required=True)