summaryrefslogtreecommitdiff
path: root/src/py_post.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-29 15:56:05 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-03-29 15:56:05 -0500
commit7422fa5f3e2505dfa8f5494e4ce9e987440a57a1 (patch)
treec655ffd469f240c70393aae25d7af98b362e588b /src/py_post.cc
parent08f65eeadc288ecde4b8fb281e477958c8ae7cd5 (diff)
downloadfork-ledger-7422fa5f3e2505dfa8f5494e4ce9e987440a57a1.tar.gz
fork-ledger-7422fa5f3e2505dfa8f5494e4ce9e987440a57a1.tar.bz2
fork-ledger-7422fa5f3e2505dfa8f5494e4ce9e987440a57a1.zip
Allow post.cost to work in Python
Diffstat (limited to 'src/py_post.cc')
-rw-r--r--src/py_post.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/py_post.cc b/src/py_post.cc
index 2789082e..ce3bd71b 100644
--- a/src/py_post.cc
+++ b/src/py_post.cc
@@ -149,11 +149,15 @@ void export_post()
make_getter(&post_t::amount),
make_setter(&post_t::amount))
.add_property("cost",
- make_getter(&post_t::cost),
- make_setter(&post_t::cost))
+ make_getter(&post_t::cost,
+ return_value_policy<return_by_value>()),
+ make_setter(&post_t::cost,
+ return_value_policy<return_by_value>()))
.add_property("assigned_amount",
- make_getter(&post_t::assigned_amount),
- make_setter(&post_t::assigned_amount))
+ make_getter(&post_t::assigned_amount,
+ return_value_policy<return_by_value>()),
+ make_setter(&post_t::assigned_amount,
+ return_value_policy<return_by_value>()))
.def("has_tag", py_has_tag_1s)
.def("has_tag", py_has_tag_1m)