def post(self): event = Event() event.name = self.request.get("name") event.description = self.request.get("description") event.local = self.request.get("local") event.date = self.request.get("date") event.time = self.request.get("time") event.linkFacebook = self.request.get("facebook_link") event.eventTag = "default-tag" event.author = "default" if self.request.get("image"): event.image = db.Blob(images.resize(self.request.get("image"), 300)) event.put() self.redirect("/events")
def post(self): event = Event() date_string = self.request.get("date") event.name = self.request.get("name") event.description = self.request.get("description") event.location = self.request.get("location") event.date = datetime.strptime(date_string, '%Y-%m-%d').date() event.time = self.request.get("time") event.linkFacebook = self.request.get("facebook_link") event.eventTag = "default-tag" event.author = "default" if self.request.get("image"): event.image = db.Blob(images.resize(self.request.get("image"), 600)) event.put() self.redirect("/events")