def post(self): if not isUserDelivery(self): self.session[LOGIN_NEXT_PAGE_KEY] = self.URL self.redirect("/") return day=getBaseDate(self) weekKey = self.request.get("weekKey") try: amount = int(self.request.get("todayPaid")) week = UserWeekOrder.get(weekKey) if day.weekday() == 0: week.mondayPaid = amount elif day.weekday() == 1: week.tuesdayPaid = amount elif day.weekday() == 2: week.wednesdayPaid = amount elif day.weekday() == 3: week.thursdayPaid = amount elif day.weekday() == 4: week.fridayPaid = amount elif day.weekday() == 5: week.saturdayPaid = amount elif day.weekday() == 6: week.sundayPaid = amount week.put() except: pass self.redirect(DeliveryReviewOrdersPage.URL + "?day=" + str(day));
def getUserWeek(key): client = memcache.Client() week = client.get(str(key)) # If not in memcache, does nothing if week != None: return week else: weekDb = UserWeekOrder.get(key) if (weekDb == None): return None week = createWeekDb(weekDb) client.add(str(key), week) return week