我是烧瓶的新手,我想将下拉列表添加到具有预定义值的表单(不从数据库中获取)。我创建了一个模型如下。
class DeliveryDetails(Model):
_tablename_ = 'deliverydetails'
id = Column(Integer, primary_key=True)
customer_name = Column(String(250), nullable=False)
delivery_type = Column(String(250), nullable=False)
并查看如下。
class DeliveryDetailsView(ModelView, DeleteMixin):
datamodel = SQLAInterface(models.DeliveryDetails)
list_columns = ['customer_name','delivery_type']
search_columns = ['customer_name','delivery_type']
edit_columns = ['customer_name','delivery_type']
add_columns = edit_columns
label_columns = {
'customer_name': _("Customer Name"),
'delivery_type': _("Delivery Type") }
我想在下拉列表中Air, Land, Sea
显示。Delivery Types
请让我知道是否可以按照我提到的那样做?