From a1c33fec022d53c9d5831d00f26ffcc6f69a007d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 30 Mar 2012 00:38:59 -0500 Subject: Allow dates to be passed to Python value() method --- src/py_value.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/py_value.cc') diff --git a/src/py_value.cc b/src/py_value.cc index efeb4340..b931f008 100644 --- a/src/py_value.cc +++ b/src/py_value.cc @@ -59,6 +59,11 @@ namespace { const datetime_t& moment) { return value.value(moment, in_terms_of); } + boost::optional py_value_2d(const value_t& value, + const commodity_t * in_terms_of, + const date_t& moment) { + return value.value(datetime_t(moment), in_terms_of); + } PyObject * py_base_type(value_t& value) { @@ -265,6 +270,7 @@ void export_value() .def("value", py_value_0) .def("value", py_value_1, args("in_terms_of")) .def("value", py_value_2, args("in_terms_of", "moment")) + .def("value", py_value_2d, args("in_terms_of", "moment")) //.def("value", &value_t::value, value_overloads()) .def("exchange_commodities", &value_t::exchange_commodities, -- cgit v1.2.3