def post(self): count = dec(self.request.get('count')) pricing = Decimal(str(get_pricing_per_individual(count))) total_price = Decimal('0') participants = [] host_info = get_host_info(self.request) host_info.put() group = ParticipantGroup() group.title = self.request.get('organization_1') + '/' + self.request.get('email_1') group.host_info = host_info group.put() primary_participant = None for x in range(count): i = str(x + 1) full_name = self.request.get('full_name_' + i) if full_name: participant = Participant() participant.full_name = full_name participant.email = self.request.get('email_' + i) participant.mobile_number = self.request.get('mobile_number_' + i) participant.address = self.request.get('address_' + i) participant.phone_number = self.request.get('phone_number_' + i) participant.designation = self.request.get('designation_' + i) participant.organization = self.request.get('organization_' + i) participant.department = self.request.get('department_' + i) participant.country_code = self.request.get('country_code_' + i) participant.state_province = self.request.get('state_province_' + i) participant.city = self.request.get('city_' + i) participant.zip_code = self.request.get('zip_code_' + i) participant.pricing = pricing if x == 0: participant.is_primary = True primary_participant = participant participant.group = group total_price += pricing participants.append(participant) tax_amount = (total_price * PRICING_TAX) tax_amount = tax_amount.quantize(Decimal('.01'), rounding=ROUND_DOWN) calculated_price = total_price total_price = total_price + tax_amount self.session['calculated_price'] = calculated_price self.session['tax_amount'] = tax_amount self.session['total_price'] = total_price self.session['participant_count'] = count self.session['participants'] = participants self.session['participant_group'] = group self.session['primary_participant'] = primary_participant self.redirect('/register/payment/')
def post(self): participant = Participant() participant.full_name = self.request.get("full_name") participant.email = self.request.get("email") participant.mobile_number = self.request.get("mobile_number") participant.phone_number = self.request.get("phone_number") participant.pricing = Decimal(self.request.get("pricing")) participant.designation = self.request.get("designation") participant.department = self.request.get("department") participant.organization = self.request.get("organization") participant.address = self.request.get("address") participant.put() queue_mail_task( url="/worker/mail/thanks/registration/", params=dict(full_name=participant.full_name, email=participant.email, key=str(participant.key())), method="POST", ) self.response.out.write(participant.to_json("full_name", "is_starred", "is_deleted", "is_active"))
def post(self): participant = Participant() participant.full_name = self.request.get('full_name') participant.email = self.request.get('email') participant.mobile_number = self.request.get('mobile_number') participant.phone_number = self.request.get('phone_number') participant.pricing = Decimal(self.request.get('pricing')) participant.designation = self.request.get('designation') participant.department = self.request.get('department') participant.organization = self.request.get('organization') participant.address = self.request.get('address') participant.put() queue_mail_task(url='/worker/mail/thanks/registration/', params=dict( full_name=participant.full_name, email = participant.email, key=str(participant.key()) ), method='POST' ) self.response.out.write(participant.to_json('full_name', 'is_starred', 'is_deleted', 'is_active'))