wtforms conversion and implemtation