def get(self): user1 = UserProfile(email = "*****@*****.**") user1.put() evt = EventInfo(owner = user1.key, title = "partyyyyyyyy", start_time = datetime(2013, 11, 18, 18, 00), duration_minutes = 800) evt.tokens = ["babayaga"] evt.put()
def post(self): date_start_window=datetime.strptime(self.request.get("start"), "%d/%m/%y").date() date_end_window=datetime.strptime(self.request.get("end"), "%d/%m/%y").date() user = UserProfile.query(UserProfile.email == "kaka").get() if not user: user = UserProfile(email="kaka") user.put() tok = id_generator() evt = EventInfo(owner=user.key,title=self.request.get("title"),description=self.request.get("description"), start_window=date_start_window, end_window=date_end_window, tokens=[tok] ) evt.put() # todo: # how to connect between the submit button + how does the save work # use jQuery to save to database # use DOM interface to add recipients list # validate input - mails , valid time window # not allowing too long inputs logging.info("token=%s", tok) self.session["msg"] = "hello" + evt.title self.redirect("/")