summaryrefslogtreecommitdiff
path: root/src/py_xact.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_xact.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_xact.cc')
-rw-r--r--src/py_xact.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/py_xact.cc b/src/py_xact.cc
index d98d226c..3755dcd1 100644
--- a/src/py_xact.cc
+++ b/src/py_xact.cc
@@ -88,9 +88,6 @@ void export_xact()
return_value_policy<reference_existing_object>()),
make_setter(&xact_base_t::journal,
with_custodian_and_ward<1, 2>()))
- .add_property("posts",
- make_getter(&xact_base_t::posts),
- make_setter(&xact_base_t::posts))
.def("__len__", posts_len)
.def("__getitem__", posts_getitem,
@@ -100,6 +97,12 @@ void export_xact()
.def("remove_post", &xact_base_t::add_post)
.def("finalize", &xact_base_t::finalize)
+
+ .def("__iter__", range<return_internal_reference<> >
+ (&xact_t::posts_begin, &xact_t::posts_end))
+ .def("posts", range<return_internal_reference<> >
+ (&xact_t::posts_begin, &xact_t::posts_end))
+
.def("valid", &xact_base_t::valid)
;