Esempio n. 1
0
from Flask import Blueprint

api = Blueprint('api', __name__)

from . import tokens, users, messages
Esempio n. 2
0
from jam.timesheet.forms import Timesheet
from Flask import Blueprint

timesheet = Blueprint('timesheet', __name__)


# forms for timesheet-enter clockin-out time for weekly total hours
@app.route('/timesheet', methods=['POST', 'GET'])
def timesheet():
    pass
    We3klyTimesheet = WeeklyHours()
    D4ys = ['Mon', 'Tue', 'Wed', 'Thr', 'Fri', 'Sat', 'Sun']
    if request.method == 'POST':
        pass
        # still need request.form for iteration through form data
        result = request.form
        We3klyTimesheetRes = WeeklyHours(obj=request.form)

        return render_template("created_timesheet.html",
                               Days=D4ys,
                               WeeklyResult=result,
                               WeeklyTimesheetRes=We3klyTimesheetRes)
    return render_template('create_timesheet.html',
                           Days=D4ys,
                           form=We3klyTimesheet)
from Flask import Blueprint, request

prediction_app = Blueprint('prediction_app', __name__)

@prediction_app.route('/health', methods = ['GET'])
def health():
    if request.method == 'GET':
        return 'ok'
Esempio n. 4
0
from Flask import Blueprint

auth = Blueprint('auth', __name__)
from app import app
from Flask import flask, Blueprint

mod_trakt = Blueprint('trakt', __name__, url_prefix='/trakt')
Esempio n. 6
0
import json
from Flask import Blueprint, render_template, request, url_for, redirect
from models.store import Store

store_blueprint = Blueprint('stores', __name__)


@store_blueprint.route('/')
def index():
    stores = Store.all()
    return render_template('stores/store_index.html', stores=stores)


@store_blueprint.route('/new', methods=['GET', 'POST'])
def create_store():
    if request.method == 'POST':
        name = request.form['name']
        url_prefix = request.form['url_prefix']
        tag_name = request.form['tag_name']
        query = json.loads(request.form['query'])

        Store(name, url_prefix, tag_name, query).save_to_mongo()

    return render_template('stores/new_store.html')


@store_blueprint.route('/edit/<string:store_id>', methods=['GET', 'POST'])
def edit_store(store_id):
    store = Store.get_by_id(store_id)

    if request.method == 'POST':