This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask, render_template_string | |
| from flask_sqlalchemy import SQLAlchemy | |
| app = Flask('__name__') | |
| app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql+psycopg2://postgres:######@127.0.0.1/so_test' | |
| app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False | |
| app.config['SESSION_TYPE'] = 'sqlalchemy' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sqlalchemy import (create_engine, and_, Column, Integer, String, | |
| ForeignKey, Float) | |
| from sqlalchemy.orm import relationship, sessionmaker | |
| from sqlalchemy.ext.declarative import declarative_base | |
| import random | |
| import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ============================================================================= | |
| # routes.py | |
| # ============================================================================= | |
| @bp.route('/add_child_product', methods=['POST']) | |
| def add_child_product(): | |
| """ | |
| Handle form validation. If form is invalid, re-render form with validation | |
| errors. If the form is valid, update product spec table, close modal and | |
| reset form. | |
| """ |
NewerOlder