form.permissions.choices = [(p.id, p.perm) for p in Permission.query.
    order_by('perm')]
form.permissions.data = [p.id for p in user.permissions]
How I do to update data on many-to-many with WTForms and SQLAlchemy?