From 40a430139edd12d9f580f5616571bc3ed8709d73 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 5 Nov 2009 02:22:17 -0500 Subject: Transactions, etc., are now accessed by iterators --- src/py_account.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/py_account.cc') 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 > + (&account_t::accounts_begin, &account_t::accounts_end)) + .def("accounts", range > + (&account_t::accounts_begin, &account_t::accounts_end)) + .def("posts", range > + (&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, -- cgit v1.2.3