コード例 #1
0
def create_event_page_handler():
    print 'In create event page'
    userController = UserController()
    user = userController.get_item(session['email']) if 'email' in session else None
    spaceController = SpaceController()
    spaces = spaceController.get_items()
    return render_template("create_event.html", user=user, spaces=spaces)
コード例 #2
0
def user_login_handler():
    email = request.form['email']
    controller = UserController()
    user = controller.get_item(email)
    if user:
        session['email'] = email
        return redirect('/grind')
    else:
        return jsonify({'success': False, 'message': 'Email not in database'})
コード例 #3
0
def index():
    print 'In index page'
    userController = UserController()
    user = userController.get_item(session['email']) if 'email' in session else None
    message = request.args.get('message', None)
    if not user:
        return render_template("index.html", user=user, message=message)
    else:
        return redirect('/grind')
コード例 #4
0
def grind():
    print 'In grind page'
    controller = SpaceController()
    spaces = controller.get_items()
    userController = UserController()
    user = userController.get_item(session['email']) if 'email' in session else None
    deals_list = HubspotAPI().get_deals()
    deals = []
    for deal in deals_list:
        deals.append({'id':deal["dealId"],'name':deal["properties"]["dealname"]["value"]})
    deal_stages = ['appointmentscheduled','qualifiedtobuy','presentationscheduled','decisionmakerboughtin','contractsent','closedwon','closedlost']
    return render_template("grind.html", spaces=spaces, user=user, deals=deals, deal_stages=deal_stages)
コード例 #5
0
def create_user(email, first_name, last_name, **kwargs):
    user_controller = UserController()
    user = user_controller.get_item(email)
    if not user:
        user = user_controller.create_item(email=email, first_name=first_name, last_name=last_name, **kwargs)
    return user
コード例 #6
0
def get_user(email):
    user_controller = UserController()
    user = user_controller.get_item(email)
    return user