I\'m just getting started with Flask / Flask-WTF / SQLAlchemy, and most example CRUD code I see shows separate templates for adding / editing. It seems repetitive to have two te
The simplest way I tried to overcome this issue was to not include the SubmitField
in the form (BookForm). We can pass the form submit value as variable to the form, e.g submit='Update'
in the edit_book route and submit='Add Book'
.
In the route, populate the fields with the details related to the book if the post method is 'GET'