def post(self): addline1 = self.request.get('addline1') addline2 = self.request.get('addline2') city = self.request.get('city') zip = self.request.get('zip') mobilePhone = self.request.get('mobilePhone') contact = Contact(addline1 = addline1, addline2 = addline2, city = city, zip = zip, mobilePhone = mobilePhone) contact_key = contact.put() session = get_current_session() session['contact_key'] = contact_key session['addline1'] = addline1 session['addline2'] = addline2 session['city'] = city session['zip'] = zip session['mobilePhone'] = mobilePhone
def post(self): firstName = self.request.get('firstName') middleName = self.request.get('middleName') lastName = self.request.get('lastName') dateOfBirth = str(self.request.get('dateOfBirth')) if(dateOfBirth): dob = datetime.strptime(dateOfBirth, '%Y-%m-%d').date() #Dates are of type: 2014-03-22 else: dob = None person = Person(firstName = firstName, middleName = middleName, lastName = lastName, dateOfBirth = dob) person_key = person.put() session = get_current_session() session['person_key'] = person_key session['firstName'] = firstName session['middleName'] = middleName session['lastName'] = lastName session['dateOfBirth'] = dateOfBirth self.redirect('/addContact')
def get(self): template_values = get_current_session().data template = JINJA_ENVIRONMENT.get_template('addContact.html') self.response.write(template.render(template_values))