Flask_Admin 不包括创建/编辑中的某些列,但包括在列表中
Flask_Admin not including some columns in create / edit but are included in the list
基本上如标题所说:Flask-Admin 不包括创建/编辑中的某些列,但包括在列表中。
Flask-Admin 只是不包括创建或编辑字段中的 2 列,而是将它们包括在列表中。知道为什么会这样吗?不包括的两列是 flag_type 和 filters
filters = Column(JSONSchema(FeatureFlagsFiltersSchema),
doc="This field should contain filters for the feature flag applicability")
flag_type = Column(UnicodeTextEnum(FeatureFlagType), index=True,
doc="Specifies whether the feature flag is FE or BE related")
还有许多其他列显示良好,例如姓名等。
我试过做如下的事情
form_create = ['code', 'label', 'doc', 'blanket_on_off_null', 'warn_after', 'ticket_id', 'usage_info', 'flag_type']
强制显示这些列,但它们似乎不起作用。谢谢您的帮助!如果需要,我可以 post 更多代码
可能由于这些字段的复杂性,flask-admin 无法确定应该为它们呈现什么样的表单小部件。您可以尝试使用适当的字段类型将它们添加到 form_extra_fields
中,例如:
from wtforms.fields import TextAreaField
class TestModelView(ModelView):
form_extra_fields = {
'filters': TextAreaField('filters')
}
基本上如标题所说:Flask-Admin 不包括创建/编辑中的某些列,但包括在列表中。
Flask-Admin 只是不包括创建或编辑字段中的 2 列,而是将它们包括在列表中。知道为什么会这样吗?不包括的两列是 flag_type 和 filters
filters = Column(JSONSchema(FeatureFlagsFiltersSchema),
doc="This field should contain filters for the feature flag applicability")
flag_type = Column(UnicodeTextEnum(FeatureFlagType), index=True,
doc="Specifies whether the feature flag is FE or BE related")
还有许多其他列显示良好,例如姓名等。
我试过做如下的事情
form_create = ['code', 'label', 'doc', 'blanket_on_off_null', 'warn_after', 'ticket_id', 'usage_info', 'flag_type']
强制显示这些列,但它们似乎不起作用。谢谢您的帮助!如果需要,我可以 post 更多代码
可能由于这些字段的复杂性,flask-admin 无法确定应该为它们呈现什么样的表单小部件。您可以尝试使用适当的字段类型将它们添加到 form_extra_fields
中,例如:
from wtforms.fields import TextAreaField
class TestModelView(ModelView):
form_extra_fields = {
'filters': TextAreaField('filters')
}