def _process(self): form = self._get_form() if form.validate_on_submit(): self._success_handler(form) return jsonify(success=True) return WPJinjaMixin.render_template(self.dialog_template, event=self.event, form=form, definition=self.definition)
def _process(self): agreement = self.agreement form = AgreementAnswerSubmissionForm() if form.validate_on_submit(): if agreement is None: agreement = Agreement.create_from_data( event=self.event, type_=self.definition.name, person=self.person) db.session.add(agreement) db.session.flush() if form.answer.data: agreement.accept(from_ip=request.remote_addr, on_behalf=True) agreement.attachment_filename = form.document.data.filename agreement.attachment = form.document.data.read() else: agreement.reject(from_ip=request.remote_addr, on_behalf=True) flash( _('Agreement answered on behalf of {0}').format( agreement.person_name), 'success') return jsonify(success=True) return WPJinjaMixin.render_template( 'events/agreements/dialogs/agreement_submit_answer_form.html', form=form, event=self.event, agreement=agreement)
def _process(self): agreement = self.agreement form = AgreementAnswerSubmissionForm() if form.validate_on_submit(): if agreement is None: agreement = Agreement.create_from_data(event=self.event, type_=self.definition.name, person=self.person) db.session.add(agreement) db.session.flush() if form.answer.data: agreement.accept(from_ip=request.remote_addr, on_behalf=True) agreement.attachment_filename = form.document.data.filename agreement.attachment = form.document.data.read() else: agreement.reject(from_ip=request.remote_addr, on_behalf=True) flash(_("Agreement answered on behalf of {0}".format(agreement.person_name)), 'success') return jsonify(success=True) return WPJinjaMixin.render_template('events/agreements/dialogs/agreement_submit_answer_form.html', form=form, event=self.event, agreement=agreement)
def _getBody(self, params): return WPJinjaMixin._getPageContent(self, params)
def _get_body(self, params): return WPJinjaMixin._get_page_content(self, params)
def _getBody(self, params): return WPJinjaMixin._getPageContent(self, params).encode('utf-8')