Example #1
0
def index():
	markers = get_markers(None)
	if request.args.get('rating', '') != "":
		query = [request.args.get('company', ''), request.args.get('job_type', ''), int(request.args.get('rating', ''))]
		markers = get_markers(query)
	addform = addForm()
	queryform = queryForm()
	return render_template('index.html', markers=markers, addform=addform, queryform=queryform)
Example #2
0
def add_pup():
    form = addForm()

    if form.validate_on_submit():
        name = form.name.data
        new_pup = Puppy(name)
        db.session.add(new_pup)
        db.session.commit()
        return redirect(url_for('list_pup'))
    return render_template('add_pup.html', form=form)
Example #3
0
def add():
	form = addForm(request.form)
	if request.method == 'POST' and form.validate():
		newData = Marker(form.netid.data.title(), form.company.data.title(), form.where.data.title(), form.job_type.data.title(), -1.0, int(form.rating.data))
		db.session.add(newData)
		db.session.commit()
		flash("Successful!")
	else:
		flash("I'm sorry, there was an error with your input")
	return redirect(url_for('index'))