示例#1
0
文件: api.py 项目: Mrudul/clo-summit
    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:
            speaker.presentation = self.request.get('presentation')
            speaker.presentation_filename = self.request.get('presentation_filename')
            speaker.presentation_extension = splitext(presentation_filename)[1]
        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'))
示例#2
0
    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"))
示例#3
0
文件: handlers.py 项目: droot/Batty
    def post(self, id = None):
	request = self.wsgi_request
	response = self.wsgi_response
	c = self.context

	param_dict = dict(
		first_name = request.params.first_name,
		last_name = request.params.last_name,
		desc = request.params.desc,
		twitter_handle = request.params.twitter_handle)
	content = param_dict
	speaker = Speaker(**param_dict)
	speaker = speaker.save()
	self.set_body(speaker.to_json())
	response.headers['content-type'] = 'application/json'
	return self.render()