title: Fill in a select list with jQuery [WTForms]
body: <p>I'm trying to create function which will fill in SelectField: EVENT_NAME, but the problem is when I want to send my list to SelectField. Do You know what I'm doing wrong ?</p>
  
  <p>I create function <em>autocompleteEvent</em> which ask db and return result as a list.</p>
  
  <pre><code>@app.route('/autocompleteEvent',methods=['GET'])
  def autocompleteEvent():
      today = time.strftime("%m/%d/%Y")
      json_list = []
      name=current_user.USERNAME
      q = USER.query.filter_by(USERNAME=name).first()
      ID_FEDERATION=q.FEDERATION.ID_FEDERATION
  
      q = EVENTS.query.filter_by(ID_FEDERATION=ID_FEDERATION).all()
      for i in q:
          if i.DATE&gt;=today:
              json_list.append(i.EVENT_NAME)
          else:
              continue
      print(json_list)
      search = request.args.get('term')
      app.logger.debug(search)
      return jsonify(json_list=json_list)
  </code></pre>
  
  <p>As a result I get:</p>
  
  <pre><code>{
    "json_list": [
      "UFC 205", 
      "UFC 206"
    ]
  }
  </code></pre>
  
  <p>Flask Form:</p>
  
  <pre><code>json_lists = []
  class FIGHTS(FlaskForm):
      EVENT_NAME = SelectField(u'Choose eventname',id='EVENT_NAME',choices=json_lists[])
  </code></pre>
  
  <p>jQuery code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function() {
      $.ajax({
          url: '{{ url_for("autocompleteEvent") }}'
          }).done(function (data) {
              $('EVENT_NAME').autocomplete({
              $.each(json_list, function(index, value) {
       ('EVENT_NAME').append($('&lt;option&gt;').text(json_list).attr('value', index));
              });
          });
      });
  &lt;/script&gt;
  </code></pre>