flask sqlalchemy angularjs for master detail form exercise