Hydrate order from request
422350
protected function hydrateOrders()
    {
        if (count($this->query)) {
            Logger::log(static::class . ' gathering query string', LOG_DEBUG);
            foreach ($this->query as $key => $value) {
                if ($key === self::API_ORDER_FIELD && is_array($value)) {
                    foreach ($value as $field => $direction) {
                        $this->order->addOrder($field, $direction);
                    }
                }
            }
        }
    }
236402
def get(self, session, is_recommended=None, order_mode=None, fields=[]):
        ''''''
        request = TOPRequest('taobao.logistics.companies.get')
        if not fields:
            lc = LogisticsCompany()
            fields = lc.fields
        request['fields'] = fields
        if is_recommended!=None: request['is_recommended'] = is_recommended
        if order_mode!=None: request['order_mode'] = order_mode
        self.create(self.execute(request, session))
        return self.logistics_companies
409062
def fulfill_order(self, request, pk):
        
        order = Order.objects.get(id=pk)
        order.fulfill()
        return Response(status=status.HTTP_204_NO_CONTENT)
485298
def to_request
        order = {
          order_id:      self.order_id.to_s,
          sales_tax:     self.sales_tax.to_i,
          product_type:  self.product_type.to_s
        }

      return order
    end
972146
def _get_query(self, order=None, filters=None):
        
        order = self._get_order(order)
        return self.posts.all().order_by(order)
70031
def refund_order(self, request, pk):
        
        order = Order.objects.get(id=pk)
        order.refund()
        return Response(status=status.HTTP_204_NO_CONTENT)
636856
public function sendOrder(Request $request, $order_id)
    {
        $elementIds = $request->request->get('elements', []);
        $acceptor = $this->getAuthenticatedUser();

        $basketElements = $this->doAcceptElements($order_id, $elementIds, $acceptor);

        $success = !empty($basketElements);

        if ('json' === $request->getRequestFormat()) {
            return $this->app->json([
                'success'  => $success,
                'msg'      => $success
                    ? $this->app->trans('Order has been sent')
                    : $this->app->trans('An error occured while sending, please retry  or contact an admin if problem persists'),
                'order_id' => $order_id,
            ]);
        }

        return $this->app->redirectPath('prod_orders', [
            'success' => (int) $success,
            'action'  => 'send',
        ]);
    }
1124536
protected function order()
    {
        $order = '';
        if (isset($this->request['order']) && count($this->request['order'])) {
            $orderBy = [];
            for ($i = 0, $ien = count($this->request['order']);$i<$ien;$i++) {
                $columnIdx = intval($this->request['order'][$i]['column']);
                $column = $this->columns[$columnIdx];
                if (!isset($column['orderable']) || $column['orderable'] === true) {
                    $orderBy[] = $this->toSQLColumn($column, 2).' '.(!isset($this->request['order'][$i]['dir']) || $this->request['order'][$i]['dir'] === 'asc' ? 'ASC' : 'DESC');
                }
            }
            $order = ' ORDER BY '.implode(', ', $orderBy);
        }

        return $order;
    }
108444
def order(self, *args):
    """"""
    # q.order(Employee.name, -Employee.age)
    if not args:
      return self
    orders = []
    o = self.orders
    if o:
      orders.append(o)
    for arg in args:
      if isinstance(arg, model.Property):
        orders.append(datastore_query.PropertyOrder(arg._name, _ASC))
      elif isinstance(arg, datastore_query.Order):
        orders.append(arg)
      else:
        raise TypeError('order() expects a Property or query Order; '
                        'received %r' % arg)
    if not orders:
      orders = None
    elif len(orders) == 1:
      orders = orders[0]
    else:
      orders = datastore_query.CompositeOrder(orders)
    return self.__class__(kind=self.kind, ancestor=self.ancestor,
                          filters=self.filters, orders=orders,
                          app=self.app, namespace=self.namespace,
                          default_options=self.default_options,
                          projection=self.projection, group_by=self.group_by)
8266
def QA_SU_save_order_queue(order_queue, client=DATABASE):
    
    collection = client.order_queue
    collection.create_index(
        [('account_cookie',
          ASCENDING),
         ('order_id',
          ASCENDING)],
        unique=True
    )
    for order in order_queue.values():
        order_json = order.to_dict()
        try:
            collection.update_one(
                {
                    'account_cookie': order_json.get('account_cookie'),
                    'order_id': order_json.get('order_id')
                },
                {'$set': order_json},
                upsert=True
            )
        except Exception as e:
            print(e)
1120691
def process_order(self, order):
        
        try:
            dt_orders = self._orders_by_modified[order.dt]
        except KeyError:
            self._orders_by_modified[order.dt] = OrderedDict([
                (order.id, order),
            ])
            self._orders_by_id[order.id] = order
        else:
            self._orders_by_id[order.id] = dt_orders[order.id] = order
            # to preserve the order of the orders by modified date
            move_to_end(dt_orders, order.id, last=True)

        move_to_end(self._orders_by_id, order.id, last=True)
568467
def fetch(self, order_id, data={}, **kwargs):
        "
        return super(Order, self).fetch(order_id, data, **kwargs)
1230976
def order_items(params={})
      order_items = get("/orders/#{id}/order_items")
      if order_items
        order_items["order_items"].map { |data| FetchAppAPI::OrderItem.new(data) }
      end
    end
148484
def get_queryset(self):  # pylint: disable=method-hidden
        """"""
        if self.request and self.request.query_params.get('hydrate_data', False):
            return self.queryset.prefetch_related('data__entity_set')

        return self.queryset
124202
def fetch_order(self, order_id: str) -> Order:
        """"""
        return self._fetch(f'order id={order_id}', exc=OrderNotFound)(self._order)(order_id)
724634
def request(order_Id,amount,billing_cust_name,billing_cust_address,billing_cust_city,billing_zip_code,billing_cust_state,billing_cust_country,billing_cust_email,billing_cust_tel,billing_cust_notes="",delivery_cust_name="",delivery_cust_address="",delivery_cust_city="",delivery_zip_code="",delivery_cust_state="",delivery_cust_country="",delivery_cust_email="",delivery_cust_tel="",delivery_cust_notes="")
  		checksum = getChecksum(order_Id,amount)
  		raw_request = "Merchant_Id=#{@merchant_Id}&Amount=#{amount}&Order_Id=#{order_Id}&Redirect_Url=#{@redirect_Url}&billing_cust_name=#{billing_cust_name}&billing_cust_address=#{billing_cust_address}&billing_cust_country=#{billing_cust_country}&billing_cust_state=#{billing_cust_state}&billing_cust_city=#{billing_cust_city}&billing_zip_code=#{billing_zip_code}&billing_cust_tel=#{billing_cust_tel}&billing_cust_email=#{billing_cust_email}&billing_cust_notes=#{billing_cust_notes}&delivery_cust_name=#{delivery_cust_name}&delivery_cust_address=#{delivery_cust_address}&delivery_cust_country=#{delivery_cust_country}&delivery_cust_state=#{delivery_cust_state}&delivery_cust_city=#{delivery_cust_city}&delivery_zip_code=#{delivery_zip_code}&delivery_cust_tel=#{delivery_cust_tel}&billing_cust_notes=#{delivery_cust_notes}&Checksum=#{checksum.to_s}"
  		return encrypt_data(raw_request,@working_Key,"AES-128-CBC")[0]
  	end
637858
function makeHttpRequest(reqHeaders, expectedRes, cacheHitExpected, next) {
  reqHeaders.cookie = _.reduce(reqHeaders.cookie, function(memo, val, name) {
    memo.push(name + '=' + val);
    return memo;
  }, []).join('; ');

  var start = Date.now();

  request({
    url: 'http://localhost:1337',
    method: 'GET',
    headers: reqHeaders
  }, function(err, data, body) {
    var time = Date.now() - start;

    console.log('  status:', data.statusCode);
    console.log('  body  :', body);
    console.log('  time  :', time);

    common.verify(function() {
      JSON.parse(body).should.eql(expectedRes);
      common.shouldUseCache(cacheHitExpected, time);
    });

    next();
  });
}