diff options
author | John Wiegley <johnw@newartisans.com> | 2012-03-29 15:56:05 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-03-29 15:56:05 -0500 |
commit | 7422fa5f3e2505dfa8f5494e4ce9e987440a57a1 (patch) | |
tree | c655ffd469f240c70393aae25d7af98b362e588b /src/py_commodity.cc | |
parent | 08f65eeadc288ecde4b8fb281e477958c8ae7cd5 (diff) | |
download | ledger-7422fa5f3e2505dfa8f5494e4ce9e987440a57a1.tar.gz ledger-7422fa5f3e2505dfa8f5494e4ce9e987440a57a1.tar.bz2 ledger-7422fa5f3e2505dfa8f5494e4ce9e987440a57a1.zip |
Allow post.cost to work in Python
Diffstat (limited to 'src/py_commodity.cc')
-rw-r--r-- | src/py_commodity.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/py_commodity.cc b/src/py_commodity.cc index c75b5e64..b283efcc 100644 --- a/src/py_commodity.cc +++ b/src/py_commodity.cc @@ -258,8 +258,10 @@ void export_commodity() make_getter(&commodity_pool_t::keep_base), make_setter(&commodity_pool_t::keep_base)) .add_property("price_db", - make_getter(&commodity_pool_t::price_db), - make_setter(&commodity_pool_t::price_db)) + make_getter(&commodity_pool_t::price_db, + return_value_policy<return_by_value>()), + make_setter(&commodity_pool_t::price_db, + return_value_policy<return_by_value>())) .add_property("quote_leeway", make_getter(&commodity_pool_t::quote_leeway), make_setter(&commodity_pool_t::quote_leeway)) @@ -390,11 +392,15 @@ void export_commodity() .add_property("price", py_price, py_set_price) .add_property("date", - make_getter(&annotation_t::date), - make_setter(&annotation_t::date)) + make_getter(&annotation_t::date, + return_value_policy<return_by_value>()), + make_setter(&annotation_t::date, + return_value_policy<return_by_value>())) .add_property("tag", - make_getter(&annotation_t::tag), - make_setter(&annotation_t::tag)) + make_getter(&annotation_t::tag, + return_value_policy<return_by_value>()), + make_setter(&annotation_t::tag, + return_value_policy<return_by_value>())) .def("__nonzero__", &annotation_t::operator bool) |