Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
def latest():
    from models import get_all_pitches
    # TODO: change to current pitches
    pitches = get_all_pitches()
    return render_template('latest.html', stocks=pitches)
Ejemplo n.º 6
0
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)
Ejemplo n.º 7
0
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)
Ejemplo n.º 8
0
def latest():
    from models import get_all_pitches
    # TODO: change to current pitches
    pitches = get_all_pitches()
    return render_template('latest.html', stocks=pitches)