summaryrefslogtreecommitdiff
path: root/src/py_item.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-05 02:27:29 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-05 02:27:42 -0500
commit060fc0e00bacb96d1d16163779d98c45c3999014 (patch)
tree1e6c661379f02fdc52ef107fd500438ab69f3e60 /src/py_item.cc
parent8bd16b2e8e61f914767e3d0973e83f7326f11cbc (diff)
downloadfork-ledger-060fc0e00bacb96d1d16163779d98c45c3999014.tar.gz
fork-ledger-060fc0e00bacb96d1d16163779d98c45c3999014.tar.bz2
fork-ledger-060fc0e00bacb96d1d16163779d98c45c3999014.zip
Made many object methods in Python properties
Diffstat (limited to 'src/py_item.cc')
-rw-r--r--src/py_item.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/py_item.cc b/src/py_item.cc
index ac544c6a..8a6e495a 100644
--- a/src/py_item.cc
+++ b/src/py_item.cc
@@ -109,9 +109,9 @@ void export_item()
class_< item_t > ("JournalItem", init<uint_least8_t>())
#endif
#if 1
- .def("flags", &supports_flags<>::flags)
+ .add_property("flags", &supports_flags<>::flags,
+ &supports_flags<>::set_flags)
.def("has_flags", &supports_flags<>::has_flags)
- .def("set_flags", &supports_flags<>::set_flags)
.def("clear_flags", &supports_flags<>::clear_flags)
.def("add_flags", &supports_flags<>::add_flags)
.def("drop_flags", &supports_flags<>::drop_flags)
@@ -138,6 +138,9 @@ void export_item()
.def("get_tag", py_get_tag_1s)
.def("get_tag", py_get_tag_1m)
.def("get_tag", py_get_tag_2m)
+ .def("tag", py_get_tag_1s)
+ .def("tag", py_get_tag_1m)
+ .def("tag", py_get_tag_2m)
.def("set_tag", &item_t::set_tag)
@@ -148,11 +151,11 @@ void export_item()
make_getter(&item_t::use_effective_date),
make_setter(&item_t::use_effective_date))
- .def("date", &item_t::date)
- .def("effective_date", &item_t::effective_date)
+ .add_property("date", &item_t::date, make_setter(&item_t::_date))
+ .add_property("effective_date", &item_t::effective_date,
+ make_setter(&item_t::_date_eff))
- .def("set_state", &item_t::set_state)
- .def("state", &item_t::state)
+ .add_property("state", &item_t::state, &item_t::set_state)
.def("lookup", &item_t::lookup)