from flask import Flask, render_template from widgetastic_patternfly import BootstrapSelect app = Flask(__name__) @app.route('/') def index(): options = ['Option 1', 'Option 2', 'Option 3'] select = BootstrapSelect('Select an option:', options) return render_template('index.html', select=select)
from flask_wtf import FlaskForm from wtforms import SelectField from widgetastic_patternfly import BootstrapSelect class MyForm(FlaskForm): options = ['Option 1', 'Option 2', 'Option 3'] select = SelectField('Select an option:', widget=BootstrapSelect(), choices=options)In both examples, BootstrapSelect is used to render a select form element with additional Bootstrap-select functionality, allowing users to search for options and select multiple items. The package library used is 'widgetastic_patternfly'.