diff options
author | John Wiegley <johnw@newartisans.com> | 2004-09-08 21:21:21 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-09-08 21:21:21 -0400 |
commit | 72d69d3ec90c1e0a3565d475a092d0f2051bd776 (patch) | |
tree | b82321de88bcd04ed32cf63f368a3365fcad3dd0 /journal.cc | |
parent | 3d4259e6d0ed01425ba9c35f3866fc298631c9e8 (diff) | |
download | fork-ledger-72d69d3ec90c1e0a3565d475a092d0f2051bd776.tar.gz fork-ledger-72d69d3ec90c1e0a3565d475a092d0f2051bd776.tar.bz2 fork-ledger-72d69d3ec90c1e0a3565d475a092d0f2051bd776.zip |
Python fixes; starting adding support for using item_handlers in python
Diffstat (limited to 'journal.cc')
-rw-r--r-- | journal.cc | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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<account_t *, amount_t, optional<unsigned int, std::string> >()) - .def_readwrite("entry", &transaction_t::entry) + .add_property("entry", + make_getter(&transaction_t::entry, + return_value_policy<reference_existing_object>())) .def_readwrite("account", &transaction_t::account) .def_readwrite("amount", &transaction_t::amount) .def_readwrite("cost", &transaction_t::cost) |