示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)