def create(): from models import get_all_pitches, create_action, create_pitch if request.method == "POST": data = request.form amount1,amount2 = forms.preprocess_new_pitch(data) # add new pitches and actions to mongo create_pitch(data['pitch-name'], data['ticker'], data['pitch-date']) create_action(data['pitch-name'], data['action-1'], amount1, data['ticker']) create_action(data['pitch-name'], data['action-2'], amount2, data['ticker']) pitches = get_all_pitches() return render_template('list.html', stocks=pitches)
def create(): from models import get_all_pitches, create_action, create_pitch if request.method == "POST": data = request.form amount1, amount2 = forms.preprocess_new_pitch(data) # add new pitches and actions to mongo create_pitch(data['pitch-name'], data['ticker'], data['pitch-date']) create_action(data['pitch-name'], data['action-1'], amount1, data['ticker']) create_action(data['pitch-name'], data['action-2'], amount2, data['ticker']) pitches = get_all_pitches() return render_template('list.html', stocks=pitches)
def update(ticker): from models import update_pitch_status, get_all_pitches update_pitch_status(ticker) pitches = get_all_pitches() pitches.sort(key=lambda x: x.created_at,reverse=True) return render_template('list.html', stocks=pitches)
def all(): from models import get_all_pitches pitches = get_all_pitches() pitches.sort(key=lambda x: x.created_at,reverse=True) return render_template('list.html', stocks=pitches)
def latest(): from models import get_all_pitches # TODO: change to current pitches pitches = get_all_pitches() return render_template('latest.html', stocks=pitches)
def update(ticker): from models import update_pitch_status, get_all_pitches update_pitch_status(ticker) pitches = get_all_pitches() pitches.sort(key=lambda x: x.created_at, reverse=True) return render_template('list.html', stocks=pitches)
def all(): from models import get_all_pitches pitches = get_all_pitches() pitches.sort(key=lambda x: x.created_at, reverse=True) return render_template('list.html', stocks=pitches)