# GncCommodityTable GncCommodityTable.add_methods_with_prefix('gnc_commodity_table_') commoditytable_dict = { 'lookup' : GncCommodity, 'lookup_unique' : GncCommodity, 'find_full' : GncCommodity, 'insert' : GncCommodity, 'add_namespace': GncCommodityNamespace, 'find_namespace': GncCommodityNamespace, } methods_return_instance(GncCommodityTable, commoditytable_dict) methods_return_instance_lists( GncCommodityTable, { 'get_namespaces_list': GncCommodityNamespace, 'get_commodities': GncCommodity, 'get_quotable_commodities': GncCommodity, } ) setattr(GncCommodityTable, 'get_namespaces', getattr(GncCommodityTable, '_get_namespaces_py')) # GncCommodityNamespace GncCommodityNamespace.add_methods_with_prefix('gnc_commodity_namespace_') GncCommodityNamespace.get_commodity_list = \ method_function_returns_instance_list( GncCommodityNamespace.get_commodity_list, GncCommodity ) # GncLot GncLot.add_constructor_and_methods_with_prefix('gnc_lot_', 'new') gnclot_dict = { 'get_account' : Account,
# GncCommodityTable GncCommodityTable.add_methods_with_prefix('gnc_commodity_table_') commoditytable_dict = { 'lookup' : GncCommodity, 'lookup_unique' : GncCommodity, 'find_full' : GncCommodity, 'insert' : GncCommodity, 'add_namespace': GncCommodityNamespace, 'find_namespace': GncCommodityNamespace, } methods_return_instance(GncCommodityTable, commoditytable_dict) methods_return_instance_lists( GncCommodityTable, { 'get_namespaces_list': GncCommodityNamespace, 'get_commodities': GncCommodity, 'get_quotable_commodities': GncCommodity, } ) setattr(GncCommodityTable, 'get_namespaces', getattr(GncCommodityTable, '_get_namespaces_py')) # GncCommodityNamespace GncCommodityNamespace.add_methods_with_prefix('gnc_commodity_namespace_') GncCommodityNamespace.get_commodity_list = \ method_function_returns_instance_list( GncCommodityNamespace.get_commodity_list, GncCommodity ) # GncLot GncLot.add_constructor_and_methods_with_prefix('gnc_lot_', 'new') gnclot_dict = { 'get_account' : Account,
GnuCashBusinessEntity.add_methods_with_prefix('gncOwner') owner_dict = { 'GetGUID': GUID, 'GetCustomer': Customer, 'GetVendor': Vendor, 'GetEmployee': Employee, 'GetJob': Job, 'GetAddr': Address, 'GetCurrency': GncCommodity, 'GetEndOwner': GnuCashBusinessEntity, 'GetBalanceInCurrency': GncNumeric, } methods_return_instance(GnuCashBusinessEntity, owner_dict) methods_return_instance_lists(GnuCashBusinessEntity, {'GetCommoditiesList': GncCommodity}) # Customer Customer.add_constructor_and_methods_with_prefix('gncCustomer', 'Create') Customer.add_method('gncOwnerApplyPayment', 'ApplyPayment') customer_dict = { 'GetAddr': Address, 'GetShipAddr': Address, 'GetDiscount': GncNumeric, 'GetCredit': GncNumeric, 'GetTerms': BillTerm, 'GetCurrency': GncCommodity, 'GetTaxTable': TaxTable, } methods_return_instance(Customer, customer_dict)
owner_dict = { 'GetGUID' : GUID, 'GetCustomer' : Customer, 'GetVendor' : Vendor, 'GetEmployee' : Employee, 'GetJob' : Job, 'GetAddr' : Address, 'GetCurrency' : GncCommodity, 'GetEndOwner': GnuCashBusinessEntity, 'GetBalanceInCurrency': GncNumeric, } methods_return_instance(GnuCashBusinessEntity, owner_dict) methods_return_instance_lists( GnuCashBusinessEntity, { 'GetCommoditiesList': GncCommodity }) # Customer Customer.add_constructor_and_methods_with_prefix('gncCustomer', 'Create') Customer.add_method('gncOwnerApplyPayment', 'ApplyPayment') customer_dict = { 'GetAddr' : Address, 'GetShipAddr' : Address, 'GetDiscount' : GncNumeric, 'GetCredit' : GncNumeric, 'GetTerms' : BillTerm, 'GetCurrency' : GncCommodity, 'GetTaxTable': TaxTable, }