summaryrefslogtreecommitdiff
path: root/src/py_account.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-05 02:22:17 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-05 02:22:17 -0500
commit40a430139edd12d9f580f5616571bc3ed8709d73 (patch)
tree8779adff41b86aaaa4137673823c4d621611bb9d /src/py_account.cc
parent111881f3cea1266206c7ea6382e44d70ed71f37a (diff)
downloadfork-ledger-40a430139edd12d9f580f5616571bc3ed8709d73.tar.gz
fork-ledger-40a430139edd12d9f580f5616571bc3ed8709d73.tar.bz2
fork-ledger-40a430139edd12d9f580f5616571bc3ed8709d73.zip
Transactions, etc., are now accessed by iterators
Diffstat (limited to 'src/py_account.cc')
-rw-r--r--src/py_account.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/py_account.cc b/src/py_account.cc
index 7fa30d0a..3341c948 100644
--- a/src/py_account.cc
+++ b/src/py_account.cc
@@ -177,8 +177,6 @@ void export_account()
.def_readwrite("name", &account_t::name)
.def_readwrite("note", &account_t::note)
.def_readonly("depth", &account_t::depth)
- .def_readonly("accounts", &account_t::accounts)
- .def_readonly("posts", &account_t::posts)
.def(self_ns::str(self))
@@ -201,6 +199,13 @@ void export_account()
.def("__len__", accounts_len)
.def("__getitem__", accounts_getitem, return_internal_reference<1>())
+ .def("__iter__", range<return_internal_reference<> >
+ (&account_t::accounts_begin, &account_t::accounts_end))
+ .def("accounts", range<return_internal_reference<> >
+ (&account_t::accounts_begin, &account_t::accounts_end))
+ .def("posts", range<return_internal_reference<> >
+ (&account_t::posts_begin, &account_t::posts_end))
+
.def("has_xdata", &account_t::has_xdata)
.def("clear_xdata", &account_t::clear_xdata)
.def("xdata", py_xdata,