from django.forms.models import ModelChoiceField
主要功能:在form表单校检中使用的字段,可以在前端直接生成select选择框
但在建表的时候要制定def __str__方法,并返回self.name等作为select中的选择
from django.forms.models import ModelChoiceField
主要功能:在form表单校检中使用的字段,可以在前端直接生成select选择框
但在建表的时候要制定def __str__方法,并返回self.name等作为select中的选择