Fixed problem with the Python build
This commit is contained in:
parent
5517871144
commit
520ece2164
4 changed files with 21 additions and 7 deletions
|
|
@ -338,13 +338,10 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
value_t get_seq(item_t& item) {
|
value_t get_seq(item_t& item) {
|
||||||
return item.pos ? long(item.pos->sequence) : 0L;
|
return long(item.seq());
|
||||||
}
|
}
|
||||||
value_t get_id(item_t& item) {
|
value_t get_id(item_t& item) {
|
||||||
if (optional<value_t> ref = item.get_tag(_("UUID")))
|
return string_value(item.id());
|
||||||
return *ref;
|
|
||||||
else
|
|
||||||
return item.pos ? long(item.pos->sequence) : 0L;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
value_t get_addr(item_t& item) {
|
value_t get_addr(item_t& item) {
|
||||||
|
|
|
||||||
13
src/item.h
13
src/item.h
|
|
@ -151,6 +151,19 @@ public:
|
||||||
return ! (*this == xact);
|
return ! (*this == xact);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string id() const {
|
||||||
|
if (optional<value_t> ref = get_tag(_("UUID"))) {
|
||||||
|
return ref->to_string();
|
||||||
|
} else {
|
||||||
|
std::ostringstream buf;
|
||||||
|
buf << seq();
|
||||||
|
return buf.str();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
std::size_t seq() const {
|
||||||
|
return pos ? pos->sequence : 0L;
|
||||||
|
}
|
||||||
|
|
||||||
virtual bool has_tag(const string& tag,
|
virtual bool has_tag(const string& tag,
|
||||||
bool inherit = true) const;
|
bool inherit = true) const;
|
||||||
virtual bool has_tag(const mask_t& tag_mask,
|
virtual bool has_tag(const mask_t& tag_mask,
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,9 @@ void export_post()
|
||||||
class_< post_t, bases<item_t> > ("Posting")
|
class_< post_t, bases<item_t> > ("Posting")
|
||||||
//.def(init<account_t *>())
|
//.def(init<account_t *>())
|
||||||
|
|
||||||
|
.def("id", &post_t::id)
|
||||||
|
.def("seq", &post_t::seq)
|
||||||
|
|
||||||
.add_property("xact",
|
.add_property("xact",
|
||||||
make_getter(&post_t::xact,
|
make_getter(&post_t::xact,
|
||||||
return_internal_reference<>()),
|
return_internal_reference<>()),
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,9 @@ void export_xact()
|
||||||
;
|
;
|
||||||
|
|
||||||
class_< xact_t, bases<xact_base_t> > ("Transaction")
|
class_< xact_t, bases<xact_base_t> > ("Transaction")
|
||||||
|
.def("id", &xact_t::id)
|
||||||
|
.def("seq", &xact_t::seq)
|
||||||
|
|
||||||
.add_property("code",
|
.add_property("code",
|
||||||
make_getter(&xact_t::code),
|
make_getter(&xact_t::code),
|
||||||
make_setter(&xact_t::code))
|
make_setter(&xact_t::code))
|
||||||
|
|
@ -117,8 +120,6 @@ void export_xact()
|
||||||
.def("add_post", &xact_t::add_post, with_custodian_and_ward<1, 2>())
|
.def("add_post", &xact_t::add_post, with_custodian_and_ward<1, 2>())
|
||||||
|
|
||||||
.def("magnitude", &xact_t::magnitude)
|
.def("magnitude", &xact_t::magnitude)
|
||||||
.def("idstring", &xact_t::idstring)
|
|
||||||
.def("id", &xact_t::id)
|
|
||||||
|
|
||||||
.def("lookup", &xact_t::lookup)
|
.def("lookup", &xact_t::lookup)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue