def action_add_shipping(self, resource, context, form): shop = get_shop(resource) # We get shipping way shipping_way = shop.get_resource('shippings/%s/' % form['shipping_way']) # We get add_record view add_record_view = shipping_way.order_add_view # We get shipping way add form schema schema = add_record_view.schema # We get form try: form = process_form(context.get_form_value, schema) except FormError, error: context.form_error = error return self.on_form_error(resource, context)
def action_edit_payment(self, resource, context, form): shop = get_shop(resource) # We get shipping way payment_way = shop.get_resource('payments/%s/' % form['payment_way']) # We get order_edit_view view = payment_way.order_edit_view # We get schema schema = view.schema # We get form try: form = process_form(context.get_form_value, schema) except FormError, error: context.form_error = error return self.on_form_error(resource, context)