From 72d69d3ec90c1e0a3565d475a092d0f2051bd776 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 8 Sep 2004 21:21:21 -0400 Subject: Python fixes; starting adding support for using item_handlers in python --- journal.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'journal.cc') diff --git a/journal.cc b/journal.cc index 3806e411..b7d1d921 100644 --- a/journal.cc +++ b/journal.cc @@ -397,6 +397,11 @@ using namespace ledger; BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(journal_find_account_overloads, find_account, 1, 2) +entry_t& transaction_entry(const transaction_t& xact) +{ + return *xact.entry; +} + unsigned int transactions_len(entry_t& entry) { return entry.transactions.size(); @@ -504,7 +509,9 @@ void export_journal() class_< transaction_t > ("Transaction") .def(init >()) - .def_readwrite("entry", &transaction_t::entry) + .add_property("entry", + make_getter(&transaction_t::entry, + return_value_policy())) .def_readwrite("account", &transaction_t::account) .def_readwrite("amount", &transaction_t::amount) .def_readwrite("cost", &transaction_t::cost) -- cgit v1.2.3