diff options
Diffstat (limited to 'src/py_account.cc')
-rw-r--r-- | src/py_account.cc | 9 |
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, |