Exemple #1
0
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))
Exemple #2
0
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))
Exemple #3
0
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')
Exemple #4
0
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')
Exemple #5
0
def view_closet(category):
    items = db.find_category(category)
    return json.dumps(items, default=json_util.default)
Exemple #6
0
def view_closet(category):
    items=db.find_category(category)
    return json.dumps(items, default=json_util.default)