Exemplo n.º 1
0
def home():
	if session.has_key('logged_in'):
		data = [(u'footwear', u'footwear'),(u'fasion wholesale', u'fasion wholesale'),\
		(u'guest services', u'guest services'),(u'eyewear', u'eyewear'),\
		(u'books and digital media', u'books and digital media'),(u"women's shoes", u"women's shoes"),\
		(u"women's clothing", u"women's clothing"),(u'makeup', u'makeup'),(u"children's footwear", u"children's footwear"),\
		(u'diamonds', u'diamonds'),(u'skincare', u'skincare'),(u'cellular accessories', u'cellular accessories'),\
		(u"women's jewelry", u"women's jewelry"),(u'clothing & shoes', u'clothing & shoes'),(u'sporting goods', u'sporting goods'),\
		(u'chocolates', u'chocolates'),(u'personalized gifts', u'personalized gifts'),(u'shoes', u'shoes'),\
		(u"men's gifts", u"men's gifts"),(u'stuffed animals', u'stuffed animals'),(u'headwear', u'headwear'),\
		(u"children's apparel", u"children's apparel"),(u'clothing', u'clothing'),(u'consumer electronics', u'consumer electronics'),\
		(u'candles', u'candles'),(u'sports apparel', u'sports apparel'),(u'home furnishings', u'home furnishings'),\
		(u'furniture', u'furniture'),(u'video games', u'video games'),(u'sports clothing', u'sports clothing'),\
		(u"men's clothing", u"men's clothing"),(u"children's clothing", u"children's clothing"),(u'cookies', u'cookies'),\
		(u'restaurant', u'restaurant'),(u'nutritional supplements', u'nutritional supplements'),(u'denim', u'denim'),\
		(u'beauty products', u'beauty products'),(u' beauty products', u' beauty products'),(u'disney', u'disney'),\
		(u"women's handbags", u"women's handbags"),(u'plus size clothing', u'plus size clothing'),(u'telecommunication', u'telecommunication'),\
		(u'coffee', u'coffee'),(u'jewelry', u'jewelry'),(u'hair care', u'hair care'),(u' accessories', u' accessories'),\
		(u"girl's clothing", u"girl's clothing"),(u'department store', u'department store'),(u'maternity clothing', u'maternity clothing'),\
		(u'ice cream', u'ice cream'),(u' clothing', u' clothing'),(u'photography', u'photography'),(u'mattress', u'mattress'),\
		(u'perfume', u'perfume')]
		data.sort()
		form = categoriesForm()
		form.category.choices = data
		if request.method == 'POST' and form.validate_on_submit():
			session["selectedCategories"] = form.category.data
			return redirect(url_for('storesNumber'))
		else:
			return render_template('home.html', form = form)

	else:
		return redirect(url_for('login'))
Exemplo n.º 2
0
def home():
	if session.has_key('logged_in'):
		data = [("Womens's Clothing","Women's Clothing" ), ("Men's Clothing", "Men's Clothing"), ('Consumer Electronics','Consumer Electronics')]
		form = categoriesForm()
		form.category.choices = data
		if request.method == 'POST' and form.validate_on_submit():
			session["selectedCategories"] = form.category.data
			return redirect(url_for('storesNumber'))
		else:
			return render_template('home.html', form = form)

	else:
		return redirect(url_for('login'))