예제 #1
0
파일: views.py 프로젝트: evancasey/sif-vote
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)
예제 #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)
예제 #3
0
파일: views.py 프로젝트: evancasey/sif-vote
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)
예제 #4
0
파일: views.py 프로젝트: evancasey/sif-vote
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)
예제 #5
0
파일: views.py 프로젝트: evancasey/sif-vote
def latest():
    from models import get_all_pitches
    # TODO: change to current pitches
    pitches = get_all_pitches()
    return render_template('latest.html', stocks=pitches)
예제 #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)
예제 #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)
예제 #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)