Commit c2d4dd3c authored by Christophe Francois's avatar Christophe Francois Committed by Vincent A

[lcl] Optional values in market orders

Quantity and validity date are not always available.
parent 5ac0490f
...@@ -1063,7 +1063,7 @@ class MarketOrdersPage(LoggedPage, HTMLPage): ...@@ -1063,7 +1063,7 @@ class MarketOrdersPage(LoggedPage, HTMLPage):
MARKET_ORDER_DIRECTIONS, MARKET_ORDER_DIRECTIONS,
MarketOrderDirection.UNKNOWN MarketOrderDirection.UNKNOWN
) )
obj_quantity = CleanDecimal.French(TableCell('quantity')) obj_quantity = CleanDecimal.French(TableCell('quantity'), default=NotAvailable)
obj_ordervalue = Coalesce( obj_ordervalue = Coalesce(
CleanDecimal.French(TableCell('ordervalue_limit'), default=NotAvailable), CleanDecimal.French(TableCell('ordervalue_limit'), default=NotAvailable),
CleanDecimal.French(TableCell('ordervalue_trigger'), default=NotAvailable), CleanDecimal.French(TableCell('ordervalue_trigger'), default=NotAvailable),
...@@ -1071,7 +1071,7 @@ class MarketOrdersPage(LoggedPage, HTMLPage): ...@@ -1071,7 +1071,7 @@ class MarketOrdersPage(LoggedPage, HTMLPage):
) )
obj_state = Regexp(CleanText(TableCell('state_unitprice')), r'(.+?)(?: à|$)', default=NotAvailable) obj_state = Regexp(CleanText(TableCell('state_unitprice')), r'(.+?)(?: à|$)', default=NotAvailable)
obj_unitprice = CleanDecimal.French(TableCell('state_unitprice'), default=NotAvailable) obj_unitprice = CleanDecimal.French(TableCell('state_unitprice'), default=NotAvailable)
obj_validity_date = Date(CleanText(TableCell('validity_date')), dayfirst=True) obj_validity_date = Date(CleanText(TableCell('validity_date')), dayfirst=True, default=NotAvailable)
@method @method
class fill_market_order(ItemElement): class fill_market_order(ItemElement):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment