diff options
author | Christoph Dittmann <github@christoph-d.de> | 2018-06-17 11:23:31 +0100 |
---|---|---|
committer | Martin Michlmayr <tbm@cyrius.com> | 2019-01-25 18:31:16 -0300 |
commit | 6828b8e89bdd9328c81e81e98088143786559976 (patch) | |
tree | 1c7d56928c9fc964b10c2980a6cc9ffbf9c43b42 /src/py_post.cc | |
parent | 0e5f0792ff7cfcc2012a53fa5372f4d6d04b5948 (diff) | |
download | fork-ledger-6828b8e89bdd9328c81e81e98088143786559976.tar.gz fork-ledger-6828b8e89bdd9328c81e81e98088143786559976.tar.bz2 fork-ledger-6828b8e89bdd9328c81e81e98088143786559976.zip |
Expose post_t::given_cost over python
This fixes #1655 by making the post_t::given_cost variable accessible
over python.
This allows access to the given cost of a posting. For example, here
it will be "-2 EUR":
A -2 XXX {1 EUR} [2018-01-01] @@ 2 EUR
If a per-unit cost is given, the given_cost variable will still
contain the cost of the posting. For example, here it will be
"-4 EUR":
B -2 XXX {1 EUR} [2018-01-01] @ 2 EUR
Diffstat (limited to 'src/py_post.cc')
-rw-r--r-- | src/py_post.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/py_post.cc b/src/py_post.cc index 6195570b..525b47c2 100644 --- a/src/py_post.cc +++ b/src/py_post.cc @@ -153,6 +153,11 @@ void export_post() return_value_policy<return_by_value>()), make_setter(&post_t::cost, return_value_policy<return_by_value>())) + .add_property("given_cost", + make_getter(&post_t::given_cost, + return_value_policy<return_by_value>()), + make_setter(&post_t::given_cost, + return_value_policy<return_by_value>())) .add_property("assigned_amount", make_getter(&post_t::assigned_amount, return_value_policy<return_by_value>()), |