请问为什么 flask-admin 创建一个 modelview,在创建的时候会缺少字段??
資深大佬 : beneo 73
真的不明白到底怎么回事,试了很多也找了很多方法,谢谢大家了。这个 planId 总是不能在 create 的时候显示出来,就算只剩下这一个字段也不显示
class CourseRuleCodeInstance(Document): _id = LongField(primary_key=True) planId = LongField(required=True) type = IntField(default=1, choices=[1, 2]) title = StringField(required=True) description = StringField(required=False) priority = LongField(default=1) templateId = LongField(required=False) templateParams = DictField(required=False) code = StringField(required=True) status = IntField(default=1, choices=[0, 1, 2]) class CourseRuleCodeInstanceView(ModelView): column_default_sort = ('_id', True) column_searchable_list = ['title'] form_columns = ( 'type', 'title', 'planId', 'description', 'priority', 'code', 'status',) column_list = ['_id', 'planId', 'type', 'title', 'description', 'priority', 'code', 'status', 'dateCreated', ]
大佬有話說 (10)