def post(self, key): presentation_filename = self.request.get("presentation_filename") speaker = Speaker() speaker.full_name = self.request.get("full_name") speaker.designation = self.request.get("designation") speaker.organization = self.request.get("organization") speaker.department = self.request.get("department") speaker.organization_website = self.request.get("organization_website") speaker.city = self.request.get("city") speaker.email = self.request.get("email") speaker.mobile_number = self.request.get("mobile_number") speaker.research_topic = self.request.get("research_topic") speaker.bio_sketch = self.request.get("bio_sketch") if presentation_filename: presentation = Presentation() presentation.filename = self.request.get("presentation_filename") presentation.content = db.Blob(self.request.get("presentation")) presentation.extension = splitext(presentation_filename)[1] presentation.put() speaker.presentation_file = presentation speaker.put() queue_mail_task( url="/worker/mail/thanks/speaker_nomination/", params=dict(full_name=speaker.full_name, email=speaker.email, key=str(speaker.key())), method="POST", ) self.response.out.write(speaker.to_json("full_name", "is_starred", "is_deleted", "is_active"))
def post(self): from models import Presentation host_info = get_host_info(self.request) host_info.put() presentation_filename = self.request.get('presentation_filename') presentation = self.request.get('presentation') speaker = Speaker() speaker.full_name = self.request.get('full_name') speaker.designation = self.request.get('designation') speaker.organization = self.request.get('organization') speaker.department = self.request.get('department') speaker.organization_website = self.request.get('organization_website') speaker.city = self.request.get('city') speaker.email = self.request.get('email') speaker.mobile_number = self.request.get('mobile_number') speaker.research_topic = self.request.get('research_topic') speaker.bio_sketch = self.request.get('bio_sketch') speaker.host_info = host_info #if presentation_filename: # speaker.presentation = db.Blob(presentation) # speaker.presentation_filename = presentation_filename # speaker.presentation_extension = splitext(presentation_filename)[1] if presentation_filename: speaker_presentation = Presentation() speaker_presentation.filename = presentation_filename speaker_presentation.extension = splitext(presentation_filename)[1] speaker_presentation.content = db.Blob(presentation) speaker_presentation.put() speaker.presentation = speaker_presentation speaker.put() queue_mail_task(url='/worker/mail/thanks/speaker_nomination/', params=dict( full_name=speaker.full_name, email = speaker.email, key=str(speaker.key()) ), method='POST' ) response = render_template('thank_you.html', message_title='Thank you for nominating a speaker.', message_body='We appreciate your taking the time to nominating a speaker. We will get in touch with you soon') self.response.out.write(response)