diff options
author | John Wiegley <johnw@newartisans.com> | 2012-11-19 14:27:44 -0800 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-11-19 14:27:44 -0800 |
commit | b74e257817c000d420b99f3e36697e37ab6c8a61 (patch) | |
tree | a92b4107277facc34b875d1790b67f632c0ee01b /src/py_xact.cc | |
parent | e77e9d692aea5a061f6fde144a56de085b1a74c4 (diff) | |
parent | 6a5d6a88cd626ee563b344657faec2ceb62b7f59 (diff) | |
download | fork-ledger-b74e257817c000d420b99f3e36697e37ab6c8a61.tar.gz fork-ledger-b74e257817c000d420b99f3e36697e37ab6c8a61.tar.bz2 fork-ledger-b74e257817c000d420b99f3e36697e37ab6c8a61.zip |
Merge pull request #108 from afh/pull/python_xact_code
Fix crash when accessing the transaction code via post.xact.code using python
Diffstat (limited to 'src/py_xact.cc')
-rw-r--r-- | src/py_xact.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/py_xact.cc b/src/py_xact.cc index 3d792c7b..96674207 100644 --- a/src/py_xact.cc +++ b/src/py_xact.cc @@ -119,8 +119,8 @@ void export_xact() .def("__str__", py_xact_to_string) .add_property("code", - make_getter(&xact_t::code), - make_setter(&xact_t::code)) + make_getter(&xact_t::code, return_value_policy<return_by_value>()), + make_setter(&xact_t::code, return_value_policy<return_by_value>())) .add_property("payee", make_getter(&xact_t::payee), make_setter(&xact_t::payee)) @@ -157,6 +157,8 @@ void export_xact() make_getter(&period_xact_t::period_string), make_setter(&period_xact_t::period_string)) ; + + register_optional_to_python<std::string>(); } } // namespace ledger |