def _feed_user_choices(self, mform):
    mform.photos.choices = [(x.path, url_for('static', filename=form.
        thumbgen_filename(x.path))) for x in (lambda : Photo.query.all())]
return mform
Flask-Admin Custom Select2 Ajax Field