title: How-to customize WTForm model_form field mapping?
body: <p>I'm using Flask with Wtforms (and Flask-WTF) to create forms for model CRUD. I've run into a question I've not been able to figure out today, mainly:</p>
  
  <p>Given the following constants definitions:</p>
  
  <pre><code>ADMIN = 0
  STAFF = 1
  USER = 2
  ROLE = {
      ADMIN: 'admin',
      STAFF: 'staff',
      USER: 'user'}
  </code></pre>
  
  <p>and given the following model:</p>
  
  <pre><code>class User(db.Model, UserMixin):
      id = db.Column(db.Integer, primary_key=True)
      first_name = db.Column(db.String(80))
      last_name = db.Column(db.String(80))
      username = db.Column(db.String(80), unique=True)
      email = db.Column(db.String(120), unique=True)
      password = db.Column(db.String(160))
      role = db.Column(db.SmallInteger, default=USER.USER)
      status = db.Column(db.SmallInteger, default=USER.NEW)
  </code></pre>
  
  <p>and given the following form generation code:</p>
  
  <pre><code>UserEdit = model_form(models.User, base_class=Form, exclude=['password'])
  </code></pre>
  
  <p>Can anyone suggest a modification to the form generation that would represent <code>role</code> (a SmallInteger field) as a select field?</p>