adminx.py
from django.forms import ModelForm, CheckboxSelectMultiple, MultipleChoiceField
class YaraRulesetForm(ModelForm):
scan_file_path_list = MultipleChoiceField(choices=YaraRuleset.SCAN_FILE_PATH_CHOICES, widget=CheckboxSelectMultiple(), label="测试路径")
class YaraRulesetAdmin:
form = YaraRulesetForm
显示效果