def not_found(error): g.cartDetails = [getProductDetail(product_id) for product_id in getCartDetails()] allCategoryCursor = mongoCategoryDetails.find() allCategoriesDict = {} for doc in allCategoryCursor: allCategoriesDict[doc['type']] = doc g.all_cat_details = allCategoriesDict title = "Bazaarfunda: Oops!! You landed on no man's land." return render_template("404.html", cartDetails=g.cartDetails, title = title, all_cat_details = g.all_cat_details)
def before_request(): app.jinja_env.filters['sjoin'] = split_space g.cartDetails = [getProductDetail(product_id) for product_id in getCartDetails()] allCategoryCursor = mongoCategoryDetails.find() allCategoriesDict = {} for doc in allCategoryCursor: allCategoriesDict[doc['type']] = doc g.all_cat_details = allCategoriesDict g.recoCategory = request.args.get('recoCategory') allCategories = mongoCategoryDetails.find() allCat = [] for cat in allCategories: try: if not cat['parent']: allCat.append(cat['type']) except: allCat.append(cat['type']) g.allCategories = allCat
def catType(): try: category= getArgAsList(request, 'category')[0] except: category = 'new' listing = mongoCategoryDetails.find() categoryList = [li['type'] for li in listing] catTypeCursor = mongoCategoryDetails.find() catType = [cat for cat in catTypeCursor] if category != 'new': listingJSON = mongoCategoryDetails.find_one({'type':category}) else: listingJSON = "" listingJSON = json.dumps(listingJSON) return render_template('admin/catType.html', catType=catType, categoryList=categoryList, listingJSON=listingJSON,category=category)
def before_request(): app.jinja_env.filters['sjoin'] = split_space g.cartDetails = [ getProductDetail(product_id) for product_id in getCartDetails() ] allCategoryCursor = mongoCategoryDetails.find() allCategoriesDict = {} for doc in allCategoryCursor: allCategoriesDict[doc['type']] = doc g.all_cat_details = allCategoriesDict g.recoCategory = request.args.get('recoCategory') allCategories = mongoCategoryDetails.find() allCat = [] for cat in allCategories: try: if not cat['parent']: allCat.append(cat['type']) except: allCat.append(cat['type']) g.allCategories = allCat
def not_found(error): g.cartDetails = [ getProductDetail(product_id) for product_id in getCartDetails() ] allCategoryCursor = mongoCategoryDetails.find() allCategoriesDict = {} for doc in allCategoryCursor: allCategoriesDict[doc['type']] = doc g.all_cat_details = allCategoriesDict title = "Bazaarfunda: Oops!! You landed on no man's land." return render_template("404.html", cartDetails=g.cartDetails, title=title, all_cat_details=g.all_cat_details)
def catType(): try: category = getArgAsList(request, 'category')[0] except: category = 'new' listing = mongoCategoryDetails.find() categoryList = [li['type'] for li in listing] catTypeCursor = mongoCategoryDetails.find() catType = [cat for cat in catTypeCursor] if category != 'new': listingJSON = mongoCategoryDetails.find_one({'type': category}) else: listingJSON = "" listingJSON = json.dumps(listingJSON) return render_template('admin/catType.html', catType=catType, categoryList=categoryList, listingJSON=listingJSON, category=category)
def listingForm(): try: category= getArgAsList(request, 'category')[0] except: category = 'new' print category listing = mongoCategoryDetails.find() categoryList = [li['type'][:-1] if li['type'].endswith('s') else li['type'] for li in listing] print categoryList # for cat in categoryList: # if cat.endswith('s'): # cat = cat[:-1] admin_properties = mongo.listing.find_one() try: categoryListing = admin_properties[category] except: pass # categoryListing = listing['dummy'] try: compareitems = categoryListing['compareitems'] except: compareitems = [] try: hotbrands = categoryListing['hotbrands'] except: hotbrands = [] try: economicbrands = categoryListing['economicbrands'] except: economicbrands = [] try: topbanner = categoryListing['topbanner'] except: topbanner = [] try: right_vertical = categoryListing['right_vertical_aff'] except: right_vertical = [] try: killerDeals = categoryListing['killer'] except: killerDeals = [] try: most_reviewed = categoryListing['most_reviewed'] except: most_reviewed = [] try: custom_product_list = categoryListing['custome_item_list'] except: custom_product_list = [] try: custom_link_list = categoryListing['custom_link_list'] except: custom_link_list = [] print custom_link_list return render_template('admin/listing.html', title="Listing banner : " + category, category=category,categoryList=categoryList, compareitems=compareitems, hotbrands=hotbrands,economicbrands=economicbrands, topbanner=topbanner,killerDeals=killerDeals,most_reviewed=most_reviewed, right_vertical=right_vertical, custom_product_list=custom_product_list, custom_link_list=custom_link_list)
def getAllCategoryDetails(): Categories = mongoCategoryDetails.find() allCategoriesDict = {} for doc in Categories: allCategoriesDict[doc['type']] = doc return allCategoriesDict
def getCategories(): Categories = mongoCategoryDetails.find() Categories = [cat['type'] for cat in Categories] allCategories = {} allCategories['categories'] = Categories return Categories
def listingForm(): try: category = getArgAsList(request, 'category')[0] except: category = 'new' print category listing = mongoCategoryDetails.find() categoryList = [ li['type'][:-1] if li['type'].endswith('s') else li['type'] for li in listing ] print categoryList # for cat in categoryList: # if cat.endswith('s'): # cat = cat[:-1] admin_properties = mongo.listing.find_one() try: categoryListing = admin_properties[category] except: pass # categoryListing = listing['dummy'] try: compareitems = categoryListing['compareitems'] except: compareitems = [] try: hotbrands = categoryListing['hotbrands'] except: hotbrands = [] try: economicbrands = categoryListing['economicbrands'] except: economicbrands = [] try: topbanner = categoryListing['topbanner'] except: topbanner = [] try: right_vertical = categoryListing['right_vertical_aff'] except: right_vertical = [] try: killerDeals = categoryListing['killer'] except: killerDeals = [] try: most_reviewed = categoryListing['most_reviewed'] except: most_reviewed = [] try: custom_product_list = categoryListing['custome_item_list'] except: custom_product_list = [] try: custom_link_list = categoryListing['custom_link_list'] except: custom_link_list = [] print custom_link_list return render_template('admin/listing.html', title="Listing banner : " + category, category=category, categoryList=categoryList, compareitems=compareitems, hotbrands=hotbrands, economicbrands=economicbrands, topbanner=topbanner, killerDeals=killerDeals, most_reviewed=most_reviewed, right_vertical=right_vertical, custom_product_list=custom_product_list, custom_link_list=custom_link_list)