'Create an Order object based on information in the database.'

@classmethod
def from_database(cls, data, reserved_ticks):

    (trader_id, order_number, price, price_type, quantity, quantity_type, traded_quantity, timeout, order_timestamp, completed_timestamp, is_ask, cancelled) = data
    order_id = OrderId(TraderId(str(trader_id)), OrderNumber(order_number))
    order = cls(order_id, Price(price, str(price_type)), Quantity(quantity, str(quantity_type)), Timeout(timeout), Timestamp(order_timestamp), bool(is_ask))
    order._traded_quantity = Quantity(traded_quantity, str(quantity_type))
    order._cancelled = bool(cancelled)
    if completed_timestamp:
        order._completed_timestamp = Timestamp(completed_timestamp)
    for (reserved_order_id, quantity) in reserved_ticks:
        order.reserved_ticks[reserved_order_id] = quantity
        order._reserved_quantity += quantity
    return order
