def create_test_binary_goal(self): goal = Goal(setup.get_test_user(), "Test Binary goal", "Have you created a goal today?", "weekly", 7, "binary", "daily") goal.persist() return goal
def create_test_numeric_goal(self): goal = Goal(setup.get_test_user(), "Test Numeric goal", "How many goals have you created today?", "weekly", 7, "numeric", "daily") goal.persist() return goal
def create_goal(): validate_form(request.form, [ "name", "prompt", "frequency", "target", "input_type", "check_in_frequency" ]) goal = Goal(current_user, request.form['name'], request.form['prompt'], request.form['frequency'], request.form['target'], request.form['input_type'], request.form['check_in_frequency']) goal.persist() return goal.to_json(), 201
def create_test_binary_goal(self): goal = Goal(setup.get_test_user(), "Test Binary goal", "Have you created a goal today?", "weekly", 7, "binary", "daily") goal.persist() return goal
def create_test_numeric_goal(self): goal = Goal(setup.get_test_user(), "Test Numeric goal", "How many goals have you created today?", "weekly", 7, "numeric", "daily") goal.persist() return goal
def create_goal(): validate_form(request.form, ["name", "prompt", "frequency", "target", "input_type", "check_in_frequency"]) goal = Goal(current_user, request.form['name'], request.form['prompt'], request.form['frequency'], request.form['target'], request.form['input_type'], request.form['check_in_frequency']) goal.persist() return goal.to_json(), 201
def create_test_goal(self): goal = Goal(self.test_user, "test goal", "is this goal a test?", "weekly", 10, "binary", "daily") goal.persist() return goal