def wear(category): print "received", category, "request" form = Today(request.form) form.items.choices = [(i['_id'],i['item']) for i in db.find_category(category)] if request.method == 'POST': #and form.validate(): #look into validate and why returning False here db.worn(form.items.data) print 'worn updated for', db.find_item(form.items.data)['item'] return render_template('index.html', form=Category(request.form))
def wear(category): print "received", category, "request" form = Today(request.form) form.items.choices = [(i['_id'], i['item']) for i in db.find_category(category)] if request.method == 'POST': #and form.validate(): #look into validate and why returning False here db.worn(form.items.data) print 'worn updated for', db.find_item(form.items.data)['item'] return render_template('index.html', form=Category(request.form))
def closet_items(): form = Category(request.form) print "request received" if request.method == 'POST' and form.validate(): category = form.category.data form2 = Today(request.form) form2.items.choices = [(i['_id'],i['item']) for i in db.find_category(category)] return render_template('today.html', form=form2, category=category) return render_template('index.html', form=form, category='category')
def closet_items(): form = Category(request.form) print "request received" if request.method == 'POST' and form.validate(): category = form.category.data form2 = Today(request.form) form2.items.choices = [(i['_id'], i['item']) for i in db.find_category(category)] return render_template('today.html', form=form2, category=category) return render_template('index.html', form=form, category='category')
def view_closet(category): items = db.find_category(category) return json.dumps(items, default=json_util.default)
def view_closet(category): items=db.find_category(category) return json.dumps(items, default=json_util.default)